From 96bb8750fc418e19945c989514ef41093d192e3f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 Sep 2024 14:17:51 +0200 Subject: ✨ Archaeological files - add operation name field: database, forms, search, sheet (refs #5795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_operations/wizards.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 581652c8f..e70eea676 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -172,10 +172,12 @@ class OperationWizard(Wizard): return initial keys = ( (("in_charge", "pk"), "in_charge"), - (("name",), "common_name"), + (("operation_name",), "common_name"), (("total_surface",), "surface"), ) initial.update(self.__copy_fields(file, keys)) + if not initial.get("common_name", None): + initial["common_name"] = file.name or "" if "town" not in initial: initial["town"] = [idx for idx, __ in self.get_towns()] if file.is_preventive(): -- cgit v1.2.3