aboutsummaryrefslogtreecommitdiff
path: root/apps/utils
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-11-29 16:57:26 -0600
committerluxagraf <sng@luxagraf.net>2018-11-29 16:57:26 -0600
commit4974eb58480f413c67f5f6e8fac430186eda2b62 (patch)
tree7402ecba682dbda38db4b6db221cc8378a390977 /apps/utils
parent0c2a092e8d8ad33a1c306ee9efca0da96eb56415 (diff)
uploading all recent changes ahead of sys upgrade
Diffstat (limited to 'apps/utils')
-rw-r--r--apps/utils/util.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/utils/util.py b/apps/utils/util.py
index 899b73f..415704c 100644
--- a/apps/utils/util.py
+++ b/apps/utils/util.py
@@ -95,7 +95,10 @@ def unique_slug_generator(instance, new_slug=None):
if new_slug is not None:
slug = new_slug
else:
- slug = slugify(instance.title)
+ try:
+ slug = slugify(instance.title)
+ except AttributeError:
+ slug = slugify(instance.name)
Klass = instance.__class__
qs_exists = Klass.objects.filter(slug=slug).exists()
if qs_exists: