Skip to content

Instantly share code, notes, and snippets.

@ychennay
Created March 21, 2020 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ychennay/86550c82a8479bf4c4e3b372080696bb to your computer and use it in GitHub Desktop.
Save ychennay/86550c82a8479bf4c4e3b372080696bb to your computer and use it in GitHub Desktop.
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