diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-21 17:06:53 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-02-24 18:09:08 +0100 |
commit | bc6cf94def73926e6f6bb986d61e5861a17584e2 (patch) | |
tree | ba4a7438cd6594c02938ad3211d523c6dd28a79f /archaeological_warehouse/forms.py | |
parent | 1b72554283f5c9e0644262a3f182409376870991 (diff) | |
download | Ishtar-bc6cf94def73926e6f6bb986d61e5861a17584e2.tar.bz2 Ishtar-bc6cf94def73926e6f6bb986d61e5861a17584e2.zip |
✨ treatment state refactoring -> distinct input status and treatment status (refs #6182) - treatments: search criteria
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r-- | archaeological_warehouse/forms.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index c681869ad..b100c72bc 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -52,7 +52,8 @@ from archaeological_finds.models import ( RemarkabilityType, TreatmentEmergencyType, Treatment, - TreatmentState, + TreatmentInputStatus, + TreatmentStatus, TreatmentType, ) from . import models @@ -874,10 +875,12 @@ class QAContainerMoveForm(QABasePackagingForm): if not self.cleaned_data.get("create_treatment", False): return treat_type = TreatmentType.objects.get(pk=self.cleaned_data['treatment_type']) - treat_state = TreatmentState.get_completed_state() + treat_input_status = TreatmentInputStatus.get_validated_state() + treat_status = TreatmentStatus.get_completed_state() try: - location = models.Warehouse.objects.get(pk=self.cleaned_data.get("qalocation", None)) + location = models.Warehouse.objects.get( + pk=self.cleaned_data.get("qalocation", None)) except models.Warehouse.DoesNotExist: location = None @@ -890,7 +893,8 @@ class QAContainerMoveForm(QABasePackagingForm): person_id=self.cleaned_data['person'], organization_id=self.cleaned_data['organization'], history_modifier=user, - treatment_state=treat_state + input_status=treat_input_status, + treatment_status=treat_status, ) t.treatment_types.add(treat_type) t.save() |