Opened 8 years ago

Closed 8 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

Description

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 by Matthew Schinckel, 8 years ago

I have a minimal example at https://bitbucket.org/schinckel/runs_before/src

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

comment:2 by Tim Graham, 8 years ago

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 by Matthew Schinckel, 8 years ago

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 by Simon Charette, 8 years ago

Resolution: duplicate
Status: newclosed

Closing as duplicate of #24075.

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