From c6a26037e3722e794d94248e89bd397ed2cbbd75 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 15 Jun 2008 18:42:15 +0000 Subject: [PATCH] newforms-admin: Custom form for changing a user's password now sets root_path manually (it doesn't have access to an AdminSite instance so it has to roll its own) git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7639 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py index 7b20606721..d796e62004 100644 --- a/django/contrib/auth/views.py +++ b/django/contrib/auth/views.py @@ -10,6 +10,7 @@ from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.html import escape from django.utils.translation import ugettext as _ from django.contrib.auth.models import User +import re def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME): "Displays the login form and handles the login action." @@ -124,4 +125,5 @@ def user_change_password(request, id): 'original': user, 'save_as': False, 'show_save': True, + 'root_path': re.sub('auth/user/(\d+)/password/$', '', request.path), }, context_instance=RequestContext(request))