From 867f4cd31f1f9a52d7e31a11ba7288f1bfb30d4f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 17 Jun 2019 15:23:32 +0200 Subject: Fix cached label check --- ishtar_common/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ishtar_common/utils.py') 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): -- cgit v1.2.3