diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-11-16 19:10:01 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:19 +0100 |
commit | c0c0f67e4f6150de5c3cee7b13ef257a367486b9 (patch) | |
tree | 101ceae0727da1829d5761dd65ac5d89d091a479 /archaeological_operations/wizards.py | |
parent | 2e15f5fd3525120d22336faf10e960050aaefb67 (diff) | |
download | Ishtar-c0c0f67e4f6150de5c3cee7b13ef257a367486b9.tar.bz2 Ishtar-c0c0f67e4f6150de5c3cee7b13ef257a367486b9.zip |
Operation from file creation - fix automatic town association and parcel recopy
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r-- | archaeological_operations/wizards.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 44b3988eb..cafb7598b 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -138,7 +138,7 @@ class OperationWizard(Wizard): Show a specific warning if no archaeological file is provided """ datas = super(OperationWizard, self).get_formated_datas(forms) - # if the general town form is used the advertissement is relevant + # if the general town form is used the advertisement is relevant has_no_af = [ form.prefix for form in forms if form.prefix == "townsgeneral-operation" ] and True @@ -186,6 +186,8 @@ class OperationWizard(Wizard): (("total_surface",), "surface"), ) initial.update(self.__copy_fields(file, keys)) + if "town" not in initial: + initial["town"] = [idx for idx, __ in self.get_towns()] if file.is_preventive(): return initial keys = ( |