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