summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-05-18 16:01:47 +0200
committerClaude Paroz <claude@2xlibre.net>2013-05-18 16:01:47 +0200
commit710c59bf9b09ee5afae2e555c30e13ed59fa4583 (patch)
treeeb8ee61442e04592c54a1ecb5307fabf4a66004e
parentdc43fbc2f21c12e34e309d0e8a121020391aa03a (diff)
Slightly reworked imports in contrib.auth.__init__
-rw-r--r--django/contrib/auth/__init__.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
index 17f6b895c7..e032038775 100644
--- a/django/contrib/auth/__init__.py
+++ b/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]