django
django copied to clipboard
Fixes #35103
Adds a custom validation message and code to a UniqueConstraint when it is set (and not only on conditional constraints).
@gabn88 Thanks for this patch :+1: Even if we will decide to do this without a deprecation period (I'm not convinced we can since it is a documented behavior), documentation change and release notes are missing.
Will add those changes to docs. TBH I would appreciate a downstream merge into 4.1/4.2, since it only fixes unexpected behavior that when you set a custom message it does not show. If you don't set a custom message still the default message shows.
If you want to set a custom message now you'd have to override the validation on clean which can become quite elaborate with many fields.
Will add those changes to docs. TBH I would appreciate a downstream merge into 4.1/4.2, since it only fixes unexpected behavior that when you set a custom message it does not show. If you don't set a custom message still the default message shows.
This doesn't qualify for a backport. If something is documented, it cannot also be unexpected.
Fair enough
@felixxm so it can land in 5.1?
@felixxm so it can land in 5.1?
Yes.
@felixxm I tried to fix the docs and release notes, but it is failing. Could you please lend me a hand here? How should I mention an attribute/class in the docs/releases?
@felixxm It seems all tests are passing. Good to go?
Anything more to do to get this merged?
Hello @gabn88! This PR is not showing in the Django "PR pending review" list because the corresponding ticket hasn't been updated.
The proper procedure to get a re-review is described in these docs. Specifically, this is the relevant part:
Check the “Has patch” box on the ticket and make sure the “Needs documentation”, “Needs tests”, and “Patch needs improvement” boxes aren’t checked. This makes the ticket appear in the “Patches needing review” queue on the Development dashboard.
This means that you need to unset the "needs documentation" flags in ticket-35103 so this PR gets added back to the "branches needing review" section of the Django Developer Dahsboard.
@sarahboyce I don't know what happened, but I lost all changes when trying to rebase.
Will look into this later, but I'm too busy right now to find out how to recover the changes.
@sarahboyce I have managed to get the repo rebased onto 5.2 and applied most of the changes. Would you mind doing another review?
@sarahboyce Thanks for the review, I must have misunderstood part the of comments. I have applied your suggestions.