Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class AbstractBaseUser(models.Model):
password = models.CharField(_('password'), max_length=128)
last_login = models.DateTimeField(_('last login'), blank=True, null=True)
is_active = True
# ....
def is_anonymous(self):
Always return False. This is a way of comparing User objects to
anonymous users.
return False
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