summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index e13633d90..0ac13e43a 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -52,7 +52,6 @@ from ishtar_common.models import (
post_delete_record_relation,
post_save_cache,
ValueGetter,
- BulkUpdatedItem,
RelationItem,
Town,
get_current_profile,
@@ -461,7 +460,6 @@ class GeographicSubTownItem(GeoItem):
class ContextRecord(
- BulkUpdatedItem,
DocumentItem,
BaseHistorizedItem,
CompleteIdentifierItem,
@@ -1286,8 +1284,15 @@ def context_record_post_save(sender, **kwargs):
cached_label_changed(sender=sender, **kwargs)
post_save_geo(sender=sender, **kwargs)
instance = kwargs.get("instance", None)
- if instance and instance.pk:
- ContextRecordTree.update(instance.pk)
+ if not instance or not instance.pk:
+ return
+ ContextRecordTree.update(instance.pk)
+ BaseFind = apps.get_model("archaeological_finds", "BaseFind")
+ Find = apps.get_model("archaeological_finds", "Find")
+ for bf in instance.base_finds.all():
+ cached_label_changed(BaseFind, instance=bf)
+ for f in bf.find.all():
+ cached_label_changed(Find, instance=f)
post_save.connect(context_record_post_save, sender=ContextRecord)