#37049: Changing a m2m through= from one custom model to another is no-op'd instead
of raising an error
-------------------------------------+-------------------------------------
Reporter: Clifford | Owner: Clifford Gama
Gama |
Type: Bug | Status: assigned
Component: | Version: dev
Migrations | Keywords: migrations,
Severity: Normal | ManyToManyField, through
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Bug in b25aee3b7bef07dd07bed2209efcdf1a8146112c of ticket #22476.
The check to make changes to field options like `blank=True` on m2m's with
a custom through model no-ops is currently only checking that both through
models were non-auto-created
[
https://github.com/django/django/blob/1b0d46f715849de53563aaf6912b4ded7d61641d/django/db/backends/base/schema.py#L882-L893
source], rather than verifying they are the same model. This means any two
custom through models would satisfy the check and short-circuit.
See regression test in attached PR for how to reproduce.
--
Ticket URL: <
https://code.djangoproject.com/ticket/37049>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.