Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms-admin: Custom form for changing a user's password now sets r…

…oot_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
  • Loading branch information...
commit c6a26037e3722e794d94248e89bd397ed2cbbd75 1 parent e8cd408
Simon Willison authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django/contrib/auth/views.py
View
2  django/contrib/auth/views.py
@@ -10,6 +10,7 @@
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))
Please sign in to comment.
Something went wrong with that request. Please try again.