mirror of
https://github.com/django/django.git
synced 2025-04-06 06:26:41 +00:00
magic-removal: Moved django.views.auth.login.* to django.contrib.auth.views
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2496 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
345463ad8e
commit
0ec5a547c9
@ -1,9 +1,9 @@
|
||||
from django.conf.urls.defaults import *
|
||||
|
||||
urlpatterns = patterns('',
|
||||
(r'^login/$', 'django.views.auth.login.login'),
|
||||
(r'^logout/$', 'django.views.auth.login.logout'),
|
||||
(r'^login_another/$', 'django.views.auth.login.logout_then_login'),
|
||||
(r'^login/$', 'django.contrib.auth.view.login'),
|
||||
(r'^logout/$', 'django.contrib.auth.views.logout'),
|
||||
(r'^login_another/$', 'django.contrib.auth.views.logout_then_login'),
|
||||
|
||||
(r'^register/$', 'ellington.registration.views.registration.signup'),
|
||||
(r'^register/(?P<challenge_string>\w{32})/$', 'ellington.registration.views.registration.register_form'),
|
||||
|
@ -3,7 +3,7 @@ from django.conf.urls.defaults import *
|
||||
urlpatterns = patterns('',
|
||||
('^$', 'django.contrib.admin.views.main.index'),
|
||||
('^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': 'django.conf'}),
|
||||
('^logout/$', 'django.views.auth.login.logout'),
|
||||
('^logout/$', 'django.contrib.auth.views.logout'),
|
||||
('^password_change/$', 'django.views.registration.passwords.password_change'),
|
||||
('^password_change/done/$', 'django.views.registration.passwords.password_change_done'),
|
||||
('^template_validator/$', 'django.contrib.admin.views.template.template_validator'),
|
||||
|
@ -23,7 +23,7 @@ def flatpage(request, url):
|
||||
# If registration is required for accessing this page, and the user isn't
|
||||
# logged in, redirect to the login page.
|
||||
if f.registration_required and request.user.is_anonymous():
|
||||
from django.views.auth.login import redirect_to_login
|
||||
from django.contrib.auth.views import redirect_to_login
|
||||
return redirect_to_login(request.path)
|
||||
if f.template_name:
|
||||
t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))
|
||||
|
@ -1,4 +1,4 @@
|
||||
from django.views.auth import login
|
||||
from django.contrib.auth.views import redirect_to_login
|
||||
|
||||
def user_passes_test(test_func, login_url=login.LOGIN_URL):
|
||||
"""
|
||||
@ -10,7 +10,7 @@ def user_passes_test(test_func, login_url=login.LOGIN_URL):
|
||||
def _checklogin(request, *args, **kwargs):
|
||||
if test_func(request.user):
|
||||
return view_func(request, *args, **kwargs)
|
||||
return login.redirect_to_login(request.path, login_url)
|
||||
return redirect_to_login(request.path, login_url)
|
||||
return _checklogin
|
||||
return _dec
|
||||
|
||||
|
@ -2,7 +2,7 @@ from django.core.xheaders import populate_xheaders
|
||||
from django.template import loader
|
||||
from django import forms
|
||||
from django.db.models import FileField
|
||||
from django.views.auth.login import redirect_to_login
|
||||
from django.contrib.auth.views import redirect_to_login
|
||||
from django.template import RequestContext
|
||||
from django.core.paginator import ObjectPaginator, InvalidPage
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
|
Loading…
x
Reference in New Issue
Block a user