diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-11 19:05:37 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-12 09:15:26 +0200 |
commit | 4e6d13e817d2389d5bb9b2a7848b6e9705e28912 (patch) | |
tree | db671670ae807fcda792af6d242bc42edf66f171 /archaeological_finds/models_finds.py | |
parent | e6f2a8071106a83816e4128df93762246668238d (diff) | |
download | Ishtar-4e6d13e817d2389d5bb9b2a7848b6e9705e28912.tar.bz2 Ishtar-4e6d13e817d2389d5bb9b2a7848b6e9705e28912.zip |
🐛 sheet find: fix display for simple treatment with no container associated
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index a5ff20773..53a1e3eef 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -3658,13 +3658,14 @@ class FindTreatment(models.Model): db_table = 'archaeological_finds_find_treatments' def location_type_label(self): - return LOCATION_TYPE_DICT[self.location_type] + if self.location_type in LOCATION_TYPE_DICT: + return LOCATION_TYPE_DICT[self.location_type] def generate_full_location(self): if getattr(self, "_full_location_set", False) or self.full_location or ( not self.treatment.is_current_container_changer and not self.treatment.is_reference_container_changer): - return + return False if self.treatment.is_current_container_changer: if self.treatment.is_reference_container_changer: self.location_type = "B" @@ -3678,6 +3679,7 @@ class FindTreatment(models.Model): self.full_location = self.container_ref.generate_full_location() self._full_location_set = True self.save() + return True class Property(LightHistorizedItem): |