From fe03f6091e1a5a34882c224a5ee837b6b9b22ef5 Mon Sep 17 00:00:00 2001 From: http Date: Thu, 11 May 2017 01:58:23 +0300 Subject: [PATCH] fix bug --- abonapp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abonapp/models.py b/abonapp/models.py index 8adae59..a9433b2 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -333,7 +333,7 @@ class Abon(UserProfile): def save(self, *args, **kwargs): # проверяем не-ли у кого такого-же ip - if Abon.objects.filter(ip_address=self.ip_address).count() > 0: + if Abon.objects.filter(ip_address=self.ip_address).exclude(pk=self.pk).count() > 0: self.is_bad_ip = True raise LogicError(_('Ip address already exist')) super(Abon, self).save(*args, **kwargs)