Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Slightly reworked imports in contrib.auth.__init__

  • Loading branch information...
commit 710c59bf9b09ee5afae2e555c30e13ed59fa4583 1 parent dc43fbc
@claudep claudep authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 django/contrib/auth/__init__.py
View
9 django/contrib/auth/__init__.py
@@ -1,9 +1,11 @@
import re
-from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed
+from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.utils.module_loading import import_by_path
+from .signals import user_logged_in, user_logged_out, user_login_failed
+
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_backend'
REDIRECT_FIELD_NAME = 'next'
@@ -14,7 +16,6 @@ def load_backend(path):
def get_backends():
- from django.conf import settings
backends = []
for backend_path in settings.AUTHENTICATION_BACKENDS:
backends.append(load_backend(backend_path))
@@ -106,7 +107,6 @@ def logout(request):
def get_user_model():
"Return the User model that is active in this project"
- from django.conf import settings
from django.db.models import get_model
try:
@@ -120,8 +120,7 @@ def get_user_model():
def get_user(request):
- from django.conf import settings
- from django.contrib.auth.models import AnonymousUser
+ from .models import AnonymousUser
try:
user_id = request.session[SESSION_KEY]
backend_path = request.session[BACKEND_SESSION_KEY]
Please sign in to comment.
Something went wrong with that request. Please try again.