fixed CustomUser
This commit is contained in:
parent
e7f11e9556
commit
5c6e0cf7c6
2 changed files with 29 additions and 24 deletions
|
|
@ -51,6 +51,7 @@ class CustomUser(AbstractBaseUser):
|
|||
objects = MyUserManager()
|
||||
|
||||
USERNAME_FIELD = "email"
|
||||
REQUIRED_FIELDS = ['name','password']
|
||||
|
||||
@classmethod
|
||||
def register(cls, name, password, email):
|
||||
|
|
@ -74,6 +75,10 @@ class CustomUser(AbstractBaseUser):
|
|||
user.validated = 1
|
||||
return True
|
||||
return False
|
||||
def is_superuser(self):
|
||||
return True
|
||||
def is_admin(self):
|
||||
return True
|
||||
|
||||
def get_full_name(self):
|
||||
# The user is identified by their email address
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue