Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29094 closed Bug (fixed)

ForeignKeyRawIdWidget.label_and_url_for_value does not catch UUIDField ValidationError

Reported by: Carel Burger Owned by: Tim Graham
Component: contrib.admin Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The UUIDField was recently changed where get_db_prep_value now calls to_python which does not raise a ValueError but a ValidationError instead.
https://github.com/django/django/commit/2f9861d823620da7ecb291a8f005f53da12b1e89

When an user enters an invalid UUID in the raw id field, the ValidationError is not caught in ForeignKeyRawIdWidget.label_and_url_for_value as it is expecting a ValueError and not a ValidationError.

Attachments (1)

29094.patch (857 bytes ) - added by Carel Burger 6 years ago.

Download all attachments as: .zip

Change History (8)

by Carel Burger, 6 years ago

Attachment: 29094.patch added

comment:1 by Carel Burger, 6 years ago

Has patch: set
Needs tests: set

comment:2 by Carel Burger, 6 years ago

Easy pickings: set

comment:3 by Tim Graham, 6 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham, 6 years ago

Needs tests: unset

comment:5 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 552abffa:

Fixed #29094 -- Fixed crash when entering an invalid uuid in ModelAdmin.raw_id_fields.

Regression in 2f9861d823620da7ecb291a8f005f53da12b1e89.

Thanks Carel Burger for the report and fix.

comment:6 by Tim Graham <timograham@…>, 6 years ago

In 1bd45e2:

[2.0.x] Fixed #29094 -- Fixed crash when entering an invalid uuid in ModelAdmin.raw_id_fields.

Regression in 2f9861d823620da7ecb291a8f005f53da12b1e89.

Thanks Carel Burger for the report and fix.

Backport of 552abffab16cbdff571486b683e7e7ef12e46066 from master

comment:7 by Tim Graham <timograham@…>, 6 years ago

In 1c9233b1:

[1.11.x] Fixed #29094 -- Fixed crash when entering an invalid uuid in ModelAdmin.raw_id_fields.

Regression in 2f9861d823620da7ecb291a8f005f53da12b1e89.

Thanks Carel Burger for the report and fix.

Backport of docs552abffab16cbdff571486b683e7e7ef12e46066 from master

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