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
commit9bc4c9e4a729dbf9fa522efaa0e0bde7c3fc148c (patch)
treece936d9cfef2af775ecb87ae410b0241b2114047 /archaeological_operations/forms.py
parent5b990051ebb23ed11092065b86ce257ec5ba1209 (diff)
downloadIshtar-9bc4c9e4a729dbf9fa522efaa0e0bde7c3fc148c.tar.bz2
Ishtar-9bc4c9e4a729dbf9fa522efaa0e0bde7c3fc148c.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