diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-07-10 21:17:59 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-07-10 21:17:59 +0200 |
commit | 7b397b211a66672a522fc4e1814df853326e7b55 (patch) | |
tree | 2a83454d3f112a8bbec584853c04f96b61be18d3 /archaeological_operations/wizards.py | |
parent | e412768a265d572a3bf8c01cb2827e32125ea11d (diff) | |
download | Ishtar-7b397b211a66672a522fc4e1814df853326e7b55.tar.bz2 Ishtar-7b397b211a66672a522fc4e1814df853326e7b55.zip |
Parcel management: copy parcel from file to operation when associating a parcel from the file
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r-- | archaeological_operations/wizards.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index b31e7b7f6..081281d8a 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2012-2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2012-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -111,10 +111,11 @@ class OperationWizard(Wizard): parcels = [] current_parcels = [] operation = self.get_current_object() - for parcel in operation.parcels.all(): - current_parcels.append((parcel.town, parcel.section, - parcel.parcel_number)) - parcels.append((parcel.pk, parcel.short_label)) + if operation: + for parcel in operation.parcels.all(): + current_parcels.append((parcel.town, parcel.section, + parcel.parcel_number)) + parcels.append((parcel.pk, parcel.short_label)) try: for parcel in file.parcels.all(): if (parcel.town, parcel.section, parcel.parcel_number) \ |