Refs #24553 -- Fixed urlpatterns leakage in auth_tests

This commit is contained in:
Riccardo Magliocchetti 2015-05-19 11:10:04 +02:00 committed by Tim Graham
parent 1046c8afec
commit ae1efb853c
2 changed files with 3 additions and 4 deletions

View File

@ -3,7 +3,7 @@ from django.contrib import admin
from django.contrib.auth import views
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.urls import urlpatterns as auth_urlpatterns
from django.contrib.messages.api import info
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
@ -65,7 +65,7 @@ def custom_request_auth_login(request):
return views.login(request, authentication_form=CustomRequestAuthenticationForm)
# special urls for auth test cases
urlpatterns += [
urlpatterns = auth_urlpatterns + [
url(r'^logout/custom_query/$', views.logout, dict(redirect_field_name='follow')),
url(r'^logout/next_page/$', views.logout, dict(next_page='/somewhere/')),
url(r'^logout/next_page/named/$', views.logout, dict(next_page='password_reset')),

View File

@ -2,7 +2,6 @@ from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.urls import urlpatterns
site = admin.AdminSite(name='custom_user_admin')
@ -16,6 +15,6 @@ class CustomUserAdmin(UserAdmin):
site.register(get_user_model(), CustomUserAdmin)
urlpatterns += [
urlpatterns = [
url(r'^admin/', include(site.urls)),
]