From 00659753bc5eeb4fe55d47f400073dd1f710cd35 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 22 Oct 2016 12:12:34 +0200 Subject: Force cache regeneration on rollback --- ishtar_common/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ishtar_common/utils.py') diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index d72b8b6ba..44112bca3 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -56,12 +56,13 @@ def cached_label_changed(sender, **kwargs): if not kwargs.get('instance'): return instance = kwargs.get('instance') - if hasattr(instance, '_cached_label_checked'): + if hasattr(instance, '_cached_label_checked') \ + and instance._cached_label_checked: return instance._cached_label_checked = True lbl = instance._generate_cached_label() if lbl != instance.cached_label: - if hasattr(instance, '_cascade_change'): + if hasattr(instance, '_cascade_change') and instance._cascade_change: instance.skip_history_when_saving = True instance.cached_label = lbl instance.save() -- cgit v1.2.3