#26647 closed Bug (fixed)
Post migrate signal old content type model
Description ¶
Since the post migrate signal has the apps argument and the update_contenttypes and create_permissions listeners use this apps argument to detect the ContentType model, there can be a bug when unapplying a migration and then applying it again. The listeners will use an old model with ContentType.name still present because this in the apps of the state that the migration executor returned.
I made a testproject were the error is replicated.
The tests for the first app will fail, but not for the second app. I tracked this down to the migration executor were in the crashing app the migrations are in front of the migration that removes the ContentType.name field in the full_plan variable, so the executor returns a state not including this ContentType model change.
If someone can push me in the right direction I am willing to make a patch for this issue.
Change History (7)
comment:1 by , 9 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 9 years ago
Component: | Uncategorized → Migrations |
---|---|
Has patch: | set |
Needs tests: | set |
Patch needs improvement: | set |
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
It ended up being faster to write a fix by myself thanks to your test project, see PR.
Could you confirm it solves your reported issue?
comment:5 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I'll have a look and try to point you in the right direction, thanks for your report.