diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-17 16:37:53 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-17 19:46:08 +0100 |
commit | 491c01c6c168c564674c12468077076bf8234af2 (patch) | |
tree | d2c109e663e64bcd1129d3ac5a18a8be7da96f86 | |
parent | c21edc6c6ec4838a44e4e4110ba2244bee5754e6 (diff) | |
download | Ishtar-491c01c6c168c564674c12468077076bf8234af2.tar.bz2 Ishtar-491c01c6c168c564674c12468077076bf8234af2.zip |
🐛 treatment type form: fix filter of treatment type by availability (refs #6143)
-rw-r--r-- | archaeological_finds/forms_treatments.py | 2 | ||||
-rw-r--r-- | archaeological_finds/models_finds.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index 0f25363ee..2c10028d4 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -313,7 +313,7 @@ class BaseTreatmentForm(CustomForm, ManageOldType): try: treatment_types = [ models.TreatmentType.objects.get( - pk=pk, available=True, + pk=pk, upstream_is_many=self.UPSTREAM_IS_MANY, downstream_is_many=self.DOWNSTREAM_IS_MANY) for pk in data.get('treatment_type', [])] diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 08cf4f4d2..f140c2d61 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -216,6 +216,7 @@ class TreatmentType(HierarchicalType): rank = types[-1].rank else: type_list = [idx for idx, __ in types] + dct["available"] = True q = cls.objects.filter(**dct).exclude(pk__in=type_list) for t in q.all(): if instances: |