#24315 closed Bug (fixed)
Using UUIDField for id of custom User model prevents password reset confirm view
Reported by: | James Beith | Owned by: | Tim Graham |
---|---|---|---|
Component: | contrib.auth | Version: | 1.8alpha1 |
Severity: | Release blocker | 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
When using the new UUIDField in Django 1.8 for the id of a custom User model, the auth view password_reset_confirm
throws a ProgrammingError
exception when it attempts to get the user.
operator does not exist: uuid = bytea LINE 1: ..." FROM "common_person" WHERE "common_person"."id" = '\x63363... HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Attachments (1)
Change History (11)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
A related PR: https://github.com/django/django/pull/3871
comment:3 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 10 years ago
Attachment: | 24315-test.diff added |
---|
comment:4 by , 10 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
I couldn't reproduce this. See previous comment for a patch which modifies an existing test in Django's test suite for password reset to use a UUIDUser
. Please reopen if you can provide more details (ideally, modifying that test so that it fails).
comment:5 by , 10 years ago
Resolution: | worksforme |
---|---|
Status: | closed → new |
The above test does fail for me. I did the following:
- Create virtual Python environment on my OS X 10.10.2 machine
- Python 3.4.2
- pip 1.5.6
- setuptools 3.6
- Cloned Django master branch
- Applied the above patch
24315-test.diff
- Ran the test
PYTHONPATH=..:$PYTHONPATH ./runtests.py auth_tests.test_views
Testing against Django installed in '/Users/James/Desktop/uuid-password-reset/django' Creating test database for alias 'default'... Creating test database for alias 'other'... ..............F................................................... ====================================================================== FAIL: test_confirm_valid_custom_user (auth_tests.test_views.CustomUserPasswordResetTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/James/Desktop/uuid-password-reset/tests/auth_tests/test_views.py", line 356, in test_confirm_valid_custom_user self.assertContains(response, "Please enter your new password") File "/Users/James/Desktop/uuid-password-reset/django/test/testcases.py", line 357, in assertContains msg_prefix + "Couldn't find %s in response" % text_repr) AssertionError: False is not true : Couldn't find 'Please enter your new password' in response ---------------------------------------------------------------------- Ran 66 tests in 1.771s FAILED (failures=1) Destroying test database for alias 'default'... Destroying test database for alias 'other'...
comment:6 by , 10 years ago
Thanks, it seems to be a difference between Python 2 and 3. I'll take another look.
comment:8 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Full traceback: