mirror of
https://github.com/django/django.git
synced 2025-07-05 10:19:20 +00:00
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
This commit is contained in:
parent
e8cd4084b7
commit
c6a26037e3
@ -10,6 +10,7 @@ from django.contrib.auth import REDIRECT_FIELD_NAME
|
|||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
import re
|
||||||
|
|
||||||
def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
|
def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
|
||||||
"Displays the login form and handles the login action."
|
"Displays the login form and handles the login action."
|
||||||
@ -124,4 +125,5 @@ def user_change_password(request, id):
|
|||||||
'original': user,
|
'original': user,
|
||||||
'save_as': False,
|
'save_as': False,
|
||||||
'show_save': True,
|
'show_save': True,
|
||||||
|
'root_path': re.sub('auth/user/(\d+)/password/$', '', request.path),
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user