feature/new-features #13

Merged
s470631 merged 7 commits from feature/new-features into master 2021-12-05 16:33:52 +01:00
Showing only changes of commit 45a4171d95 - Show all commits

View File

@ -7,3 +7,15 @@ class UserManager(BaseUserManager):
def get_queryset(self): def get_queryset(self):
return UserQuerySet(self.model, using=self._db) return UserQuerySet(self.model, using=self._db)
def create(self, email, password=None, **kwargs):
if password is None:
message = "User must have valid password"
raise ValueError(message)
user = self.model(email=email, **kwargs)
user.set_password(password)
user.save()
return user