diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-02-26 18:34:09 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-02-26 18:34:09 +0100 |
commit | c8aeaadac1156a679a4ec021f7b36784b9ab69c0 (patch) | |
tree | 04c4f2769840880c3311f34a57597372509bdcd6 /archaeological_operations/models.py | |
parent | 33fe24b1e8bb81b8e4e2f9851d967ce86616c62b (diff) | |
download | Ishtar-c8aeaadac1156a679a4ec021f7b36784b9ab69c0.tar.bz2 Ishtar-c8aeaadac1156a679a4ec021f7b36784b9ab69c0.zip |
Operations: bulk update of base find and finds (refs #3472)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 1f65b4c1f..c5ca2eae0 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -464,7 +464,7 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, return list(self.context_record.all()) def _cached_labels_bulk_update(self): - if settings.USE_SPATIALITE_FOR_TESTS: + if settings.TESTING and settings.USE_SPATIALITE_FOR_TESTS: return self.context_record.model.cached_label_bulk_update(operation_id=self.pk) return True @@ -1390,8 +1390,8 @@ def parcel_post_save(sender, **kwargs): return if parcel.context_record.count(): - for cr in parcel.context_record.all(): - cached_label_changed(cr.__class__, instance=cr) + parcel.context_record.model.cached_label_bulk_update( + parcel_id=parcel.id) if parcel.operation and parcel.operation.pk and \ parcel.town not in list(parcel.operation.towns.all()): |