diff options
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 |
commit | 74b11851bb9a3be86b8b67277c9cd6d5be7ff507 (patch) | |
tree | 93ceec0a94371020713290e2d256453b8f9cd065 /archaeological_finds/forms.py | |
parent | 452f66e422b0c4d2783527da53aca39cc06be419 (diff) | |
download | Ishtar-74b11851bb9a3be86b8b67277c9cd6d5be7ff507.tar.bz2 Ishtar-74b11851bb9a3be86b8b67277c9cd6d5be7ff507.zip |
Wizard: prevent error on form initialization when no context record is provided (should not happen but...)
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 3 |
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 |