Post migrate signal old content type model
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)
Cc: |
Simon Charette added
|
Owner: |
changed from nobody to Simon Charette
|
Status: |
new → assigned
|
Component: |
Uncategorized → Migrations
|
Has patch: |
set
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Severity: |
Normal → Release blocker
|
Triage Stage: |
Unreviewed → Accepted
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
I'll have a look and try to point you in the right direction, thanks for your report.