diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-13 20:18:40 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-13 20:18:40 +0200 |
commit | 7c555a286e07f4fc5d4676d461ccd5f242dee676 (patch) | |
tree | ce936d9cfef2af775ecb87ae410b0241b2114047 /archaeological_operations/forms.py | |
parent | 9e950721a1000b48c702802e157064076fed7962 (diff) | |
download | Ishtar-7c555a286e07f4fc5d4676d461ccd5f242dee676.tar.bz2 Ishtar-7c555a286e07f4fc5d4676d461ccd5f242dee676.zip |
Context record wizard: fix related context record association on creation
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 314e184e2..058e637f4 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -416,7 +416,9 @@ class RecordRelationsForm(ManageOldType, forms.Form): cleaned_data.get('right_record', None)): raise forms.ValidationError( _(u"You should select a relation type.")) - if str(cleaned_data.get('right_record')) == str(self.left_record.pk): + if self.left_record and \ + str(cleaned_data.get('right_record')) == str( + self.left_record.pk): raise forms.ValidationError( _(u"An operation cannot be related to herself.")) return cleaned_data |