#37049: Changing a m2m through= from one custom model to another is no-op'd
instead
of raising an error
-------------------------------------+-------------------------------------
Reporter: Clifford Gama | Owner: Clifford
| Gama
Type: Bug | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: migrations, | Triage Stage:
ManyToManyField, through | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Clifford Gama:
Old description:
> 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.
New description:
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 [https://github.com/django/django/pull/21131 PR]
for how to reproduce.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/37049#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019da2281069-dc1f89c2-7d61-466a-b41a-08cc02d6a86e-000000%40eu-central-1.amazonses.com.