summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
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
commit7c555a286e07f4fc5d4676d461ccd5f242dee676 (patch)
treece936d9cfef2af775ecb87ae410b0241b2114047 /archaeological_operations/forms.py
parent9e950721a1000b48c702802e157064076fed7962 (diff)
downloadIshtar-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.py4
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