summaryrefslogtreecommitdiff
path: root/ishtar_common/utils.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 15:23:32 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 15:23:32 +0200
commit867f4cd31f1f9a52d7e31a11ba7288f1bfb30d4f (patch)
treece4e2ad199ed883fa9d34fbe2d7fcc9d8bd69a4b /ishtar_common/utils.py
parent768d6a7b1ed35365c475e65f3b5f2a778c4de806 (diff)
downloadIshtar-867f4cd31f1f9a52d7e31a11ba7288f1bfb30d4f.tar.bz2
Ishtar-867f4cd31f1f9a52d7e31a11ba7288f1bfb30d4f.zip
Fix cached label check
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r--ishtar_common/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py
index 3db471b84..a2fdd36f3 100644
--- a/ishtar_common/utils.py
+++ b/ishtar_common/utils.py
@@ -496,7 +496,9 @@ def _cached_label_changed(sender, **kwargs):
sender, ["cached_label_changed", instance.pk]
)
cache.set(cache_key, None, settings.CACHE_TASK_TIMEOUT)
- return getattr(instance, cached_labels[0], "")
+ if cached_labels:
+ return getattr(instance, cached_labels[0], "")
+ return ""
def regenerate_all_cached_labels(model):