Code

Opened 7 years ago

Closed 7 years ago

#3645 closed (duplicate)

Change Password form in admin fails if TEMPLATE_STRING_IF_INVALID is not ''

Reported by: anonymous Owned by: adrian
Component: contrib.admin Version: master
Severity: Keywords: change password
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I think I've found a bug in the admin's Change Password form. Here's the
call to render the template from the user_change_password function in
django.contrib.admin.views.auth:

return render_to_response('admin/auth/user/change_password.html', {

'title': _('Change password: %s') % escape(user.username),
'form': form,
'is_popup': request.REQUEST.has_key('_popup'),
'add': True,
'change': False,
'has_delete_permission': False,
'has_change_permission': True,
'has_absolute_url': False,
'first_form_field_id': 'id_password1',
'opts': User._meta,
'original': user,
'show_save': True,

}, context_instance=template.RequestContext(request))

And here's the form action from
django/contrib/admin/templates/admin/auth/user/change_password.html

<form action="{{ form_url }}" method="post"
id="{{ opts.module_name }}_form">

As you can see, the action is specified as form_url, but this is never
set in the view. I assume "" would work, but I have
TEMPLATE_STRING_IF_INVALID set to something non-null, and get a whopper
of an error there.

I'm guessing the fix is something really simple ({{ form.url }} instead
of {{ form_url }} or just a dot instead of a variable), but I don't have
enough of a handle to say exactly what it should be.

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.