From 0393dfd0d4ac8d7ecf1f3443fd0f26c055765b42 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 22 Oct 2025 15:51:43 +0200 Subject: 🐛 fix regenerate cached label of childs on container move (refs #6480) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_finds/models_finds.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'archaeological_finds') 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 -- cgit v1.2.3