From c97cda3c4995eecd1f17b87ec9d616743db78401 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 26 Jan 2017 23:47:18 +0100 Subject: [PATCH] Fixed ownNo number dupe check! --- contest/forms.py | 4 ++-- contest/models.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/contest/forms.py b/contest/forms.py index b531101..76a6132 100644 --- a/contest/forms.py +++ b/contest/forms.py @@ -101,9 +101,9 @@ class QSOForm(forms.ModelForm): raise forms.ValidationError("Number has to be in range of [1, 1000000]") try: - QSO.objects.get(owner=self.user, ownNo=data) + QSO.objects.get(owner=self.user.id, ownNo=data) raise forms.ValidationError("You already logged a QSO with the number %s" % data) - except: + except QSO.DoesNotExist: return data def clean_otherNo(self): diff --git a/contest/models.py b/contest/models.py index badcb8c..75312c3 100644 --- a/contest/models.py +++ b/contest/models.py @@ -168,7 +168,6 @@ class QSO(models.Model): if checkQSO: self.checkQSOData() - print(" ==> ", self, " ==> ", self.cfmdQSO) super(QSO, self).save(*args, **kwargs) def __str__(self):