diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd1bb3..fdfee28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.5.1 (Pre-release) + +- Fix bug where slug max length was too short for titles. + ## 0.5.0 (Pre-release) - Show pīkau titles on pathway diagram when required. (fixes #49) diff --git a/config/__init__.py b/config/__init__.py index ffd7a5a..106cd83 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -1,3 +1,3 @@ """Module for Django system configuration.""" -__version__ = "0.5.0" +__version__ = "0.5.1" diff --git a/pikau/migrations/0030_auto_20180529_0956.py b/pikau/migrations/0030_auto_20180529_0956.py new file mode 100644 index 0000000..b5766d6 --- /dev/null +++ b/pikau/migrations/0030_auto_20180529_0956.py @@ -0,0 +1,38 @@ +# Generated by Django 2.0.5 on 2018-05-28 21:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pikau', '0029_auto_20180529_0726'), + ] + + operations = [ + migrations.AlterField( + model_name='glossaryterm', + name='slug', + field=models.SlugField(help_text='A unique readable identifier', max_length=200, unique=True), + ), + migrations.AlterField( + model_name='goal', + name='slug', + field=models.SlugField(max_length=200, unique=True), + ), + migrations.AlterField( + model_name='pikaucourse', + name='slug', + field=models.SlugField(max_length=200, unique=True), + ), + migrations.AlterField( + model_name='pikauunit', + name='slug', + field=models.SlugField(max_length=200), + ), + migrations.AlterField( + model_name='tag', + name='slug', + field=models.SlugField(max_length=200, unique=True), + ), + ] diff --git a/pikau/models.py b/pikau/models.py index 28c9c4c..8342ccd 100644 --- a/pikau/models.py +++ b/pikau/models.py @@ -48,6 +48,7 @@ class GlossaryTerm(models.Model): # Auto-incrementing 'id' field is automatically set by Django slug = models.SlugField( unique=True, + max_length=200, help_text="A unique readable identifier", ) term = models.CharField(max_length=200, unique=True) @@ -99,7 +100,7 @@ class Goal(models.Model): """Model for goal.""" # Auto-incrementing 'id' field is automatically set by Django - slug = models.SlugField(unique=True) + slug = models.SlugField(unique=True, max_length=200) description = models.CharField(max_length=500, unique=True) def __str__(self): @@ -115,7 +116,7 @@ class Tag(models.Model): """Model for tag.""" # Auto-incrementing 'id' field is automatically set by Django - slug = models.SlugField(unique=True) + slug = models.SlugField(unique=True, max_length=200) name = models.CharField(max_length=100, unique=True) description = models.CharField(max_length=300, blank=True) @@ -191,7 +192,7 @@ class PikauCourse(models.Model): """Model for Pikau Course.""" # Auto-incrementing 'id' field is automatically set by Django - slug = models.SlugField(unique=True) + slug = models.SlugField(unique=True, max_length=200) name = models.CharField(max_length=200, unique=True) language = models.CharField(max_length=20, choices=LANGUAGE_CHOICES) readiness_level = models.IntegerField( @@ -291,7 +292,7 @@ def __str__(self): class PikauUnit(models.Model): """Model for Pikau Unit.""" - slug = models.SlugField() + slug = models.SlugField(max_length=200) number = models.PositiveSmallIntegerField() pikau_course = models.ForeignKey( PikauCourse,