summaryrefslogtreecommitdiff
path: root/django/contrib/auth/handlers/modpython.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/auth/handlers/modpython.py')
-rw-r--r--django/contrib/auth/handlers/modpython.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/django/contrib/auth/handlers/modpython.py b/django/contrib/auth/handlers/modpython.py
index d538c9ccc8..b1d7680a33 100644
--- a/django/contrib/auth/handlers/modpython.py
+++ b/django/contrib/auth/handlers/modpython.py
@@ -10,7 +10,7 @@ def authenhandler(req, **kwargs):
# that so that the following import works
os.environ.update(req.subprocess_env)
- from django.models.auth import users
+ from django.contrib.auth.models import User
# check for PythonOptions
_str_to_bool = lambda s: s.lower() in ('1', 'true', 'on', 'yes')
@@ -21,14 +21,14 @@ def authenhandler(req, **kwargs):
superuser_only = _str_to_bool(options.get('DjangoRequireSuperuserStatus', "off"))
# check that the username is valid
- kwargs = {'username__exact': req.user, 'is_active__exact': True}
+ kwargs = {'username': req.user, 'is_active': True}
if staff_only:
- kwargs['is_staff__exact'] = True
+ kwargs['is_staff'] = True
if superuser_only:
- kwargs['is_superuser__exact'] = True
+ kwargs['is_superuser'] = True
try:
- user = users.get_object(**kwargs)
- except users.UserDoesNotExist:
+ user = User.objects.get(**kwargs)
+ except User.DoesNotExist:
return apache.HTTP_UNAUTHORIZED
# check the password and any permission given