django icon indicating copy to clipboard operation
django copied to clipboard

Fixes #35103

Open gabn88 opened this issue 1 year ago • 13 comments

Adds a custom validation message and code to a UniqueConstraint when it is set (and not only on conditional constraints).

gabn88 avatar Jan 11 '24 16:01 gabn88

@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.

felixxm avatar Jan 12 '24 07:01 felixxm

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.

gabn88 avatar Jan 12 '24 07:01 gabn88

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.

felixxm avatar Jan 12 '24 07:01 felixxm

Fair enough

gabn88 avatar Jan 12 '24 07:01 gabn88

@felixxm so it can land in 5.1?

gabn88 avatar Jan 12 '24 07:01 gabn88

@felixxm so it can land in 5.1?

Yes.

felixxm avatar Jan 12 '24 07:01 felixxm

@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?

gabn88 avatar Jan 12 '24 15:01 gabn88

@felixxm It seems all tests are passing. Good to go?

gabn88 avatar Feb 12 '24 19:02 gabn88

Anything more to do to get this merged?

gabn88 avatar May 20 '24 08:05 gabn88

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.

nessita avatar May 30 '24 13:05 nessita

@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.

gabn88 avatar Jun 04 '24 12:06 gabn88

@sarahboyce I have managed to get the repo rebased onto 5.2 and applied most of the changes. Would you mind doing another review?

gabn88 avatar Jun 04 '24 13:06 gabn88

@sarahboyce Thanks for the review, I must have misunderstood part the of comments. I have applied your suggestions.

gabn88 avatar Jun 12 '24 12:06 gabn88