summaryrefslogtreecommitdiff
path: root/archaeological_operations/wizards.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r--archaeological_operations/wizards.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index c7c375a49..01e717b18 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
@@ -114,10 +114,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) \