diff options
author | luxagraf <sng@luxagraf.net> | 2018-11-29 16:57:26 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-11-29 16:57:26 -0600 |
commit | 4974eb58480f413c67f5f6e8fac430186eda2b62 (patch) | |
tree | 7402ecba682dbda38db4b6db221cc8378a390977 /apps/utils | |
parent | 0c2a092e8d8ad33a1c306ee9efca0da96eb56415 (diff) |
uploading all recent changes ahead of sys upgrade
Diffstat (limited to 'apps/utils')
-rw-r--r-- | apps/utils/util.py | 5 |
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: |