Commits

Simon Meers committed 630b23b

EmailBasedUserManager user creation methods call validate_unique

Comments (0)

Files changed (1)

generic/user/email_based/models.py

             raise ValueError('Users must have an email address')
         user = self.model(email=self.normalize_email(email), **extra_fields)
         user.set_password(password)
+        user.validate_unique()
         user.save(using=self._db)
         return user
 
         user.is_active = True
         user.is_staff = True
         user.is_superuser = True
+        user.validate_unique()
         user.save(using=self._db)
         return user