Skip to content

Commit 56acc29

Browse files
authored
Bug: Correct length of classifier term length to 255 (#589)
#### Description of change Changes the maximum length of the slug field of ClassifierTerm to have a maximum length of 255, to match the name. This is also the maximum length that several django backends allow for unique fields: https://docs.djangoproject.com/en/4.2/ref/databases/#character-fields #### Tests Created a test project, ensured that a field with a name of a length greater than 50 did not cause errors. NOTES: This was believed to be fixed in 2.1.3, but that only corrected the slug field on classifiers, not classifier terms.
1 parent 13362be commit 56acc29

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 4.1.10 on 2023-07-13 19:18
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("coderedcms", "0038_alter_classifier_slug"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="classifierterm",
14+
name="slug",
15+
field=models.SlugField(
16+
allow_unicode=True,
17+
max_length=255,
18+
unique=True,
19+
verbose_name="Slug",
20+
),
21+
),
22+
]

coderedcms/models/snippet_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ class Meta(Orderable.Meta):
189189
allow_unicode=True,
190190
unique=True,
191191
verbose_name=_("Slug"),
192+
max_length=255,
192193
)
193194
name = models.CharField(
194195
max_length=255,

0 commit comments

Comments
 (0)