summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-05-31 19:30:38 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:49:36 +0200
commit202ffb773e61f8d107c7246910f2e864bc052123 (patch)
tree93ceec0a94371020713290e2d256453b8f9cd065
parent959d12d757ea9f03e880be165d7cca714b61c27e (diff)
downloadIshtar-202ffb773e61f8d107c7246910f2e864bc052123.tar.bz2
Ishtar-202ffb773e61f8d107c7246910f2e864bc052123.zip
Wizard: prevent error on form initialization when no context record is provided (should not happen but...)
-rw-r--r--archaeological_finds/forms.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index def29a327..a01bd45a6 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -267,7 +267,8 @@ class FindForm(CustomForm, ManageOldType):
def __init__(self, *args, **kwargs):
context_record = kwargs.pop('context_record')
super(FindForm, self).__init__(*args, **kwargs)
- if not context_record.operation.operation_type.judiciary:
+ if not context_record or \
+ not context_record.operation.operation_type.judiciary:
self.fields.pop('seal_number')
self.fields['checked'].choices = models.CHECK_CHOICES