summaryrefslogtreecommitdiff
path: root/ishtar_common/utils.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-02-25 12:11:37 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-02-25 12:11:37 +0100
commitcdb5af349c931fa12ccf642cf2080aa117dc4a1f (patch)
tree29d18903e39024ac46daf27eb2322a44252cd6ef /ishtar_common/utils.py
parent0a280ab1b2a3623780b74528d67debddd891fc6c (diff)
downloadIshtar-cdb5af349c931fa12ccf642cf2080aa117dc4a1f.tar.bz2
Ishtar-cdb5af349c931fa12ccf642cf2080aa117dc4a1f.zip
Operations: bulk update of context records (refs #3472)
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r--ishtar_common/utils.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py
index e16d1abb6..f1236a5ac 100644
--- a/ishtar_common/utils.py
+++ b/ishtar_common/utils.py
@@ -66,6 +66,10 @@ def cached_label_changed(sender, **kwargs):
if not kwargs.get('instance'):
return
instance = kwargs.get('instance')
+
+ if hasattr(instance, 'test_obj'):
+ instance.test_obj.reached(sender, **kwargs)
+
if hasattr(instance, '_cached_label_checked') \
and instance._cached_label_checked:
return
@@ -83,9 +87,14 @@ def cached_label_changed(sender, **kwargs):
if hasattr(instance, '_cascade_change') and instance._cascade_change:
instance.skip_history_when_saving = True
instance.save()
- if hasattr(instance, '_get_associated_cached_labels'):
+ updated = False
+ if hasattr(instance, '_cached_labels_bulk_update'):
+ updated = instance._cached_labels_bulk_update()
+ if not updated and hasattr(instance, '_get_associated_cached_labels'):
for item in instance._get_associated_cached_labels():
item._cascade_change = True
+ if hasattr(instance, 'test_obj'):
+ item.test_obj = instance.test_obj
cached_label_changed(item.__class__, instance=item)
SHORTIFY_STR = ugettext(" (...)")