Fixed QSO editing
This commit is contained in:
parent
0bf443035d
commit
888d33cc42
|
@ -105,9 +105,12 @@ class QSOForm(forms.ModelForm):
|
||||||
raise forms.ValidationError("Number has to be in range of [1, 1000000]")
|
raise forms.ValidationError("Number has to be in range of [1, 1000000]")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
QSO.objects.get(owner=self.user.id, ownNo=data)
|
o = QSO.objects.get(owner=self.user.id, ownNo=data)
|
||||||
|
if not (self.instance and self.instance.id and self.instance.id == o.id):
|
||||||
raise forms.ValidationError("You already logged a QSO with the number %s" % data)
|
raise forms.ValidationError("You already logged a QSO with the number %s" % data)
|
||||||
except QSO.DoesNotExist:
|
except QSO.DoesNotExist:
|
||||||
|
pass
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def clean_otherNo(self):
|
def clean_otherNo(self):
|
||||||
|
|
Loading…
Reference in New Issue