summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-10-22 15:51:43 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-10-24 18:37:06 +0200
commit0393dfd0d4ac8d7ecf1f3443fd0f26c055765b42 (patch)
tree2f88ebcd5b4b89508db617d0eaa91c4da32fc50d /archaeological_finds/models_finds.py
parentc42fba6c77d189df076164e3d159de59b76d7727 (diff)
downloadIshtar-0393dfd0d4ac8d7ecf1f3443fd0f26c055765b42.tar.bz2
Ishtar-0393dfd0d4ac8d7ecf1f3443fd0f26c055765b42.zip
🐛 fix regenerate cached label of childs on container move (refs #6480)
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index c3241afa3..432bd5467 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -3600,7 +3600,7 @@ class Find(
set_static_localisation_9.post_save = True
- def update_current_full_location(self, full_location=None):
+ def update_current_full_location(self, full_location=None, return_value=False):
"""
If relevant update full location of current container
:param full_location: provided if update is triggered from container
@@ -3614,14 +3614,18 @@ class Find(
full_location = self.container.generate_full_location()
if full_location == self.container_fisrt_full_location:
return False
+ if return_value:
+ return full_location
self.container_fisrt_full_location = full_location
else:
if self.container_fisrt_full_location == "":
return False
+ if return_value:
+ return ""
self.container_fisrt_full_location = ""
return True
- def update_ref_full_location(self, full_location=None):
+ def update_ref_full_location(self, full_location=None, return_value=False):
"""
If relevant update full location of reference container
:param full_location: provided if update is triggered from container
@@ -3635,10 +3639,14 @@ class Find(
full_location = self.container_ref.generate_full_location()
if full_location == self.container_ref_fisrt_full_location:
return False
+ if return_value:
+ return full_location
self.container_ref_fisrt_full_location = full_location
else:
if self.container_ref_fisrt_full_location == "":
return False
+ if return_value:
+ return ""
self.container_ref_fisrt_full_location = ""
return True