From c07380618dbcc61ea00a8d9b7cc03a44221edd49 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 23 Sep 2025 11:40:57 +0200 Subject: 🐛 fix treatment request creation from find basket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_finds/wizards.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py index 7f735b066..be189e3b1 100644 --- a/archaeological_finds/wizards.py +++ b/archaeological_finds/wizards.py @@ -527,6 +527,14 @@ class TreatmentFileWizard(Wizard): wizard_done_window = reverse_lazy("show-treatmentfile") redirect_url = "treatmentfile_modification" + def get_form_initial(self, step, data=None): + initial = super().get_form_initial(step, data=data) + if step != "treatmentfile-treatmentfile_creation": + return initial + if self.request.GET and "associated_basket" in self.request.GET: + initial["associated_basket_id"] = self.request.GET["associated_basket"] + return initial + def get_formated_data_for_associated_basket_id(self, value): try: value = str(models.FindBasket.objects.get(pk=value)) -- cgit v1.2.3