Bug in Admin's Change Password form

47 views
Skip to first unread message

Todd O'Bryan

unread,
Mar 2, 2007, 5:31:18 PM3/2/07
to django-d...@googlegroups.com
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.

Anybody want to fix it? :-)

Todd

Simon G.

unread,
Mar 2, 2007, 7:38:37 PM3/2/07
to Django developers
Hi Todd,

Can you drop by code.djangoproject.com and create a ticket for this,
so we don't lose trac (sorry) of it.

Thanks :)
Simon G.

Gary Wilson

unread,
Mar 2, 2007, 11:21:55 PM3/2/07
to Django developers
On Mar 2, 6:38 pm, "Simon G." <d...@simon.net.nz> wrote:
> Can you drop by code.djangoproject.com and create a ticket for this,
> so we don't lose trac (sorry) of it.

Actually, we already have one:
http://code.djangoproject.com/ticket/3579

I have also referenced this thread in the ticket so that whoever does
try to fix it doesn't miss this case.

Thanks Todd.

Simon G.

unread,
Mar 2, 2007, 11:24:02 PM3/2/07
to Django developers
I thought #3579 was more of a generic thing, but well spotted Gary!

-Simon

Gary Wilson

unread,
Mar 2, 2007, 11:53:42 PM3/2/07
to Django developers
On Mar 2, 10:24 pm, "Simon G." <d...@simon.net.nz> wrote:
> I thought #3579 was more of a generic thing, but well spotted Gary!

Yes, I just changed the title to, what I think, better convey the
intention of poster of the ticket.

Todd O'Bryan

unread,
Mar 3, 2007, 8:52:16 AM3/3/07
to django-d...@googlegroups.com
Done. #3645

Todd O'Bryan

unread,
Mar 3, 2007, 9:02:19 AM3/3/07
to django-d...@googlegroups.com
And almost immediately marked as a duplicate. :-)

Guess I should read through all of my mail before acting on any of it.

Reply all
Reply to author
Forward
0 new messages