Django

Code

Ticket #8402 (closed: fixed)

Opened 3 months ago

Last modified 3 months ago

Password change form still assumes oldforms variables

Reported by: mtredinnick Assigned to:
Milestone: 1.0 Component: Contrib apps
Version: SVN Keywords: aug22sprint
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

This is a django.contrib.auth bug, but the relevant template is "django/contrib/admin/templates/registrations/password_change_form.html": this template uses the oldforms-style html_error_list instead of .errors to display error messsages.

The reason this isn't a simple trivial change is because a test should actually be written to test that form and ensure the problem doesn't occur again. To do that:

  • put a new unittest class in django.contrib.auth.tests.views
  • modify django.contrib.auth.tests.__init__ to include the class
  • hook up a /login/ URL in django.contrib.auth.urls, since you can't change the password without logging in.
  • work out a password for the testuser in the fixture data and update the fixture data's password hash. Then document what this password is for other test users somehow (in the fixture directory maybe?). It might be possible to guess the current password; I haven't tried. But just creating the hash for a know password (e.g. "test" would be fine.
  • At least test that trying to change a password and failing displays the error messages.

Attachments

8402.add_password_change_tests_and_update_default_template_to_newforms.diff (6.2 kB) - added by mtrichardson on 08/22/08 17:35:20.

Change History

08/18/08 19:05:25 changed by mtredinnick

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

08/22/08 16:45:06 changed by mtrichardson

  • owner changed from nobody to mtrichardson.

08/22/08 17:35:20 changed by mtrichardson

  • attachment 8402.add_password_change_tests_and_update_default_template_to_newforms.diff added.

08/22/08 17:35:40 changed by mtrichardson

The previous diff adds tests in addition to fixing the problem.

08/22/08 17:36:17 changed by mtrichardson

  • owner deleted.

08/22/08 20:12:03 changed by mtrichardson

  • keywords set to aug22sprint.

08/23/08 13:20:21 changed by mtredinnick

(In [8496]) Updated password change template (in admin templates) to use current form variables (rather than oldforms stuff). Patch from Mike Richardson. Refs #8402.

08/23/08 13:21:54 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

Tests were committed in [8497], which is the last piece of this.


Add/Change #8402 (Password change form still assumes oldforms variables)




Change Properties
Action