Added authorization
This commit is contained in:
parent
d9be36b73d
commit
45a4171d95
@ -6,4 +6,16 @@ from .querysets import UserQuerySet
|
||||
class UserManager(BaseUserManager):
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user