Created
March 21, 2020 17:51
-
-
Save ychennay/86550c82a8479bf4c4e3b372080696bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbstractBaseUser(models.Model): | |
password = models.CharField(_('password'), max_length=128) | |
last_login = models.DateTimeField(_('last login'), blank=True, null=True) | |
is_active = True | |
# .... | |
@property | |
def is_anonymous(self): | |
""" | |
Always return False. This is a way of comparing User objects to | |
anonymous users. | |
""" | |
return False | |
@property | |
def is_authenticated(self): | |
""" | |
Always return True. This is a way to tell if the user has been | |
authenticated in templates. | |
""" | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment