Opened 14 years ago

Last modified 13 years ago

#14446 closed

auth.views.password_reset_confirm should never be cached — at Version 1

Reported by: Paul McMillan Owned by: Paul McMillan
Component: contrib.auth Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Gabriel Hurley)

I'm splitting this issue off from #14105, as it is separate from the meat of that ticket.

Django.contrib.auth.views.password_reset_confirm needs the never_cache decorator.

To reproduce:

1. Start a new project. Add  django.contrib.admin  and setup a sqlite database. Run manage.py test auth. Result: OK.

2. Relevant bits of settings.py:

    MIDDLEWARE_CLASSES = (
        'django.middleware.cache.UpdateCacheMiddleware',
        'django.middleware.common.CommonMiddleware',
        'django.middleware.cache.FetchFromCacheMiddleware,
    )
    CACHE_BACKEND = 'locmem://'

Run manage.py test auth. Result: (failures=1, errors=11) 

This issue is that single failure.

Change History (2)

by Paul McMillan, 14 years ago

Attachment: password_reset_fix.diff added

Adds the necessary never_cache decorator

comment:1 by Gabriel Hurley, 14 years ago

Description: modified (diff)
Triage Stage: UnreviewedReady for checkin

I can confirm that this patch fixes this test failure, specifically:

======================================================================
FAIL: test_confirm_valid (django.contrib.auth.tests.views.PasswordResetTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Development\django\trunk\django\contrib\auth\tests\views.py", line 91, in test_confirm_valid
    self.assert_("Please enter your new password" in response.content)
AssertionError: False is not True

----------------------------------------------------------------------

The other 11 errors remaining when running the tests under these conditions are still related to #14105.

Updated the description to make it easier to duplicate if anyone else wants to check it prior to committing. Marking as RFC.

Note: See TracTickets for help on using tickets.
Back to Top