summaryrefslogtreecommitdiff
path: root/django/contrib/auth/base_user.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/auth/base_user.py')
-rw-r--r--django/contrib/auth/base_user.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/contrib/auth/base_user.py b/django/contrib/auth/base_user.py
index 48ab950c43..c8f748cf02 100644
--- a/django/contrib/auth/base_user.py
+++ b/django/contrib/auth/base_user.py
@@ -10,6 +10,7 @@ from django.contrib.auth.hashers import (
)
from django.db import models
from django.utils.crypto import get_random_string, salted_hmac
+from django.utils.deprecation import CallableFalse, CallableTrue
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@@ -79,19 +80,21 @@ class AbstractBaseUser(models.Model):
def natural_key(self):
return (self.get_username(),)
+ @property
def is_anonymous(self):
"""
Always return False. This is a way of comparing User objects to
anonymous users.
"""
- return False
+ return CallableFalse
+ @property
def is_authenticated(self):
"""
Always return True. This is a way to tell if the user has been
authenticated in templates.
"""
- return True
+ return CallableTrue
def set_password(self, raw_password):
self.password = make_password(raw_password)