From 98f3cbef63f6cb02987455a048e77dc954648577 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 23 Oct 2017 09:40:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=BE=D0=B9=20=D1=84=D0=B8=D0=BA=D1=81=20=D1=81=D0=BE=D0=B7?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=8E=D0=B7=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- access/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/access/models.py b/access/models.py index e707f8b..14c590b 100755 --- a/access/models.py +++ b/access/models.py @@ -78,7 +78,8 @@ class CustomUserManager(BaseUserManager): email = self.normalize_email(email) - user = self.model(email=email, is_staff=is_staff, is_active=is_active, first_name=first_name, id=self.last().id +1, + user = self.model(email=email, is_staff=is_staff, is_active=is_active, first_name=first_name, + id=self.last().id +1 if self.last() else 0, is_superuser=is_superuser, date_joined=date_joined, last_login=last_login, **extra_fields) if not password: