check that slugify has returned anything

This commit is contained in:
Thomas Steen Rasmussen 2017-08-24 20:28:53 +02:00
parent 6e3b6002c2
commit 365827805c

View file

@ -43,6 +43,8 @@ class Village(UUIDModel, CampRelatedModel):
Village.objects.filter(slug=self.slug).count() > 1
):
slug = slugify(self.name)
if not slug:
slug = "noname"
incrementer = 1
# We have to make sure that the slug won't clash with current slugs