From cad2fa4e8b923539db96dcea60ee5af1edf26015 Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Tue, 7 Mar 2006 02:11:54 +0000 Subject: [PATCH] magic-removal: Moved django.views.decorators.auth.* to django.contrib.auth.decorators git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2497 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../auth.py => contrib/auth/decorators.py} | 0 django/contrib/comments/views/userflags.py | 2 +- django/views/registration/passwords.py | 2 +- docs/authentication.txt | 12 ++++++------ 4 files changed, 8 insertions(+), 8 deletions(-) rename django/{views/decorators/auth.py => contrib/auth/decorators.py} (100%) diff --git a/django/views/decorators/auth.py b/django/contrib/auth/decorators.py similarity index 100% rename from django/views/decorators/auth.py rename to django/contrib/auth/decorators.py diff --git a/django/contrib/comments/views/userflags.py b/django/contrib/comments/views/userflags.py index e6fa88ff45..827424d266 100644 --- a/django/contrib/comments/views/userflags.py +++ b/django/contrib/comments/views/userflags.py @@ -2,7 +2,7 @@ from django.shortcuts import render_to_response from django.template import RequestContext from django.http import Http404 from django.models.comments import comments, moderatordeletions, userflags -from django.views.decorators.auth import login_required +from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.conf import settings diff --git a/django/views/registration/passwords.py b/django/views/registration/passwords.py index 9f65a3518d..58f1e8da6b 100644 --- a/django/views/registration/passwords.py +++ b/django/views/registration/passwords.py @@ -4,7 +4,7 @@ from django.shortcuts import render_to_response from django.template import Context, RequestContext, loader from django.contrib.auth.models import User from django.contrib.sites.models import Site -from django.views.decorators.auth import login_required +from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect class PasswordResetForm(forms.Manipulator): diff --git a/docs/authentication.txt b/docs/authentication.txt index 8dc7ccc431..d4db08ad91 100644 --- a/docs/authentication.txt +++ b/docs/authentication.txt @@ -271,7 +271,7 @@ The login_required decorator As a shortcut, you can use the convenient ``login_required`` decorator:: - from django.views.decorators.auth import login_required + from django.contrib.auth.decorators import login_required def my_view(request): # ... @@ -279,7 +279,7 @@ As a shortcut, you can use the convenient ``login_required`` decorator:: Here's the same thing, using Python 2.4's decorator syntax:: - from django.views.decorators.auth import login_required + from django.contrib.auth.decorators import login_required @login_required def my_view(request): @@ -310,7 +310,7 @@ permission ``polls.can_vote``:: As a shortcut, you can use the convenient ``user_passes_test`` decorator:: - from django.views.decorators.auth import user_passes_test + from django.contrib.auth.decorators import user_passes_test def my_view(request): # ... @@ -318,7 +318,7 @@ As a shortcut, you can use the convenient ``user_passes_test`` decorator:: Here's the same thing, using Python 2.4's decorator syntax:: - from django.views.decorators.auth import user_passes_test + from django.contrib.auth.decorators import user_passes_test @user_passes_test(lambda u: u.has_perm('polls.can_vote')) def my_view(request): @@ -334,7 +334,7 @@ specify the URL for your login page (``/accounts/login/`` by default). Example in Python 2.3 syntax:: - from django.views.decorators.auth import user_passes_test + from django.contrib.auth.decorators import user_passes_test def my_view(request): # ... @@ -342,7 +342,7 @@ Example in Python 2.3 syntax:: Example in Python 2.4 syntax:: - from django.views.decorators.auth import user_passes_test + from django.contrib.auth.decorators import user_passes_test @user_passes_test(lambda u: u.has_perm('polls.can_vote'), login_url='/login/') def my_view(request):