diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 60c3ac7ef..82d4f2caa 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -56,10 +56,17 @@ def cached_label_changed(sender, **kwargs): if not kwargs.get('instance'): return instance = kwargs.get('instance') + if hasattr(instance, '_cached_label_checked'): + return + instance._cached_label_checked = True lbl = instance._generate_cached_label() if lbl != instance.cached_label: + instance.skip_history_when_saving = True instance.cached_label = lbl instance.save() + if hasattr(instance, '_get_associated_cached_labels'): + for item in instance._get_associated_cached_labels(): + cached_label_changed(item.__class__, instance=item) SHORTIFY_STR = ugettext(" (...)") |