child slugs: require non-blank

Currently it is easy for a child with non-ascii name to get empty slug:
'Мааян' 'Паскин-Чернявский' => '-'
'Мааян' 'Паскин' => ''

Once any child has an empty slug, many pages break with NoReverseMatch
errors.  This commit at least prevents setting such names;
slug computation to be fixed later.
This commit is contained in:
Beni Cherniavsky-Paskin 2021-04-23 14:38:34 +03:00 committed by Christopher Charbonneau Wells
parent 14b11db91b
commit f58571bf17
1 changed files with 1 additions and 0 deletions

View File

@ -80,6 +80,7 @@ class Child(models.Model):
verbose_name=_('Birth date')
)
slug = models.SlugField(
blank=False,
editable=False,
max_length=100,
unique=True,