Opened 7 years ago

Closed 7 years ago

#26588 closed Bug (duplicate)

Unable to reverse a run_before that refers to django.contrib.auth

Reported by: Matthew Schinckel Owned by: nobody
Component: Migrations Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


You can use run_before to ensure that something else runs before django.contrib.auth (specifically ('auth', '0001_initial'), but if you try to reverse that migration, a signal fires that tries to update permissions.

Since this will run after auth_permission has been dropped, it will result in a database error.

Change History (4)

comment:1 Changed 7 years ago by Matthew Schinckel

I have a minimal example at

Not sure how to write up a nice django test case for this though.

comment:2 Changed 7 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

#24075 describes a closely related problem caused by the fact that signal handlers run unconditionally. The solution started in PR #5835 might also fix this.

comment:3 Changed 7 years ago by Matthew Schinckel

Yeah, the behaviour is the same as migrating auth to zero. I'd missed that (my test obviously didn't unmigrate that app, only the one I was testing, which when I put the run_before cascaded to migrating auth to zero).

comment:4 Changed 7 years ago by Simon Charette

Resolution: duplicate
Status: newclosed

Closing as duplicate of #24075.

Note: See TracTickets for help on using tickets.
Back to Top