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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent e8cd408 commit c6a26037e3722e794d94248e89bd397ed2cbbd75 Simon Willison committed Jun 15, 2008
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/contrib/auth/
2 django/contrib/auth/
@@ -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))

0 comments on commit c6a2603

Please sign in to comment.