* cc: Gagaro (added)
* type: Cleanup/optimization => Bug
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Replying to [ticket:34319 Mateusz Kurowski]:
> This wont work because:
>
> {{{
> 1425, in validate_constraints
> if e.code == "unique" and len(constraint.fields) == 1:
> ^^^^^^
> AttributeError: 'ValidationError' object has no attribute 'code'
> }}}
This is a regression in 667105877e6723c6985399803a364848891513cc, that we
should fix.
> Maybe all unique constraints should allow raising validation error for
specific field like ?
I don't think that adding extra arguments is a step forward here, we
should be able to recognized violated fields by inspecting `expression`,
see #34007.
--
Ticket URL: <https://code.djangoproject.com/ticket/34319#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.