From 365827805ce3761086e93ddd571b0a845aa1af12 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Thu, 24 Aug 2017 20:28:53 +0200 Subject: [PATCH] check that slugify has returned anything --- src/villages/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/villages/models.py b/src/villages/models.py index 35a77b9b..19aa81b3 100644 --- a/src/villages/models.py +++ b/src/villages/models.py @@ -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