1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #33938 -- Fixed migration crash for m2m with a through model in another app.

Regression in aa4acc164d.

Thanks bryangeplant for the report.
This commit is contained in:
Simon Charette
2022-08-19 14:03:15 -04:00
committed by Mariusz Felisiak
parent 2480554dc4
commit 71902e0d9f
3 changed files with 50 additions and 1 deletions

View File

@@ -1422,7 +1422,7 @@ class MigrationAutodetector:
dependencies = [(dep_app_label, dep_object_name, None, True)]
if getattr(field.remote_field, "through", None):
through_app_label, through_object_name = resolve_relation(
remote_field_model,
field.remote_field.through,
app_label,
model_name,
)