summaryrefslogtreecommitdiff
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
commit9a4f70b60f753bd5b6a241eaaa8e9f5c57cd89c7 (patch)
treece4e2ad199ed883fa9d34fbe2d7fcc9d8bd69a4b
parent972d37bca63cdc36d448d9dc7b315a4c1d6fac75 (diff)
downloadIshtar-9a4f70b60f753bd5b6a241eaaa8e9f5c57cd89c7.tar.bz2
Ishtar-9a4f70b60f753bd5b6a241eaaa8e9f5c57cd89c7.zip
Fix cached label check
-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):