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: