Ignore Account.is_staff kwarg (auth.AbstractBaseUser)

This commit is contained in:
Santiago L 2021-03-30 13:56:04 +02:00
parent 14fbd98e33
commit 08a76a8de4
1 changed files with 23 additions and 18 deletions

View File

@ -52,6 +52,11 @@ class Account(auth.AbstractBaseUser):
USERNAME_FIELD = 'username' USERNAME_FIELD = 'username'
REQUIRED_FIELDS = ['email'] REQUIRED_FIELDS = ['email']
def __init__(self, *args, **kwargs):
# ignore `is_staff` kwarg because is handled with `is_superuser`
kwargs.pop('is_staff', None)
super().__init__(*args, **kwargs)
def __str__(self): def __str__(self):
return self.name return self.name