Opened 11 months ago

Closed 2 months ago

#35103 closed Cleanup/optimization (fixed)

UniqueConstraint message does not use violation_error_message

Reported by: Gerben Morsink Owned by: Gerben Morsink
Component: Database layer (models, ORM) Version: 5.1
Severity: Normal Keywords: UniqueConstraint, violation_error_message
Cc: Simon Charette 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

Although this is documented, it is unexpected. Therefore I filed it as a cleanup/optimization.

See https://forum.djangoproject.com/t/customizing-validationerror-message-on-uniqueconstraint/25105 for a (possible) patch.

Change History (19)

comment:1 by Tim Graham, 11 months ago

Has patch: unset
Triage Stage: UnreviewedAccepted
UI/UX: unset

While Simon did provide a draft patch on the forum, I'll uncheck "Has patch" until there is a pull request to review.

comment:2 by Gerben Morsink, 11 months ago

Owner: changed from nobody to Gerben Morsink
Status: newassigned

comment:4 by Gerben Morsink, 11 months ago

Has patch: set

comment:5 by Mariusz Felisiak, 11 months ago

Needs documentation: set

comment:6 by Gerben Morsink, 7 months ago

Needs documentation: unset

comment:7 by Sarah Boyce, 7 months ago

Patch needs improvement: set

comment:8 by Gerben Morsink, 7 months ago

Patch needs improvement: unset
Version: 4.1dev

comment:9 by Gerben Morsink, 6 months ago

Version: dev5.1

comment:10 by Sarah Boyce, 6 months ago

Patch needs improvement: set

comment:11 by Gerben Morsink, 6 months ago

Patch needs improvement: unset

comment:12 by Sarah Boyce, 6 months ago

Needs tests: set
Patch needs improvement: set

comment:13 by Gerben Morsink, 6 months ago

Patch needs improvement: unset

comment:14 by Gerben Morsink, 3 months ago

Needs tests: unset
Resolution: fixed
Status: assignedclosed

comment:15 by Claude Paroz, 3 months ago

Resolution: fixed
Status: closednew

Please do not close a ticket before its patch is committed in the repository. Unsetting the "Needs tests" flag should be enough to promote the patch in the review queue again!

comment:16 by Sarah Boyce, 3 months ago

Easy pickings: unset
Patch needs improvement: set

comment:17 by Gerben Morsink, 3 months ago

Somehow a lot of seemingly unrelated tests are failing on my local machine. It could have to do with https://code.djangoproject.com/ticket/30581 being merged in between the first release and the current release.

@Sarah Boyce: do you know why these lines were changed:
https://github.com/django/django/commit/13922580cccfb9ab2922ff4943dd39da56dfbd8c ?

comment:18 by Sarah Boyce, 2 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:19 by Sarah Boyce <42296566+sarahboyce@…>, 2 months ago

Resolution: fixed
Status: newclosed

In e970bb7:

Fixed #35103 -- Used provided error code and message when fields is set without a condition on UniqueConstraint.

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