More RBAC migration fixes

This commit is contained in:
Akita Noek
2016-04-27 16:59:33 -04:00
parent b670681f6c
commit af4daec314
4 changed files with 39 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
from awx.main.utils import set_current_apps
def set_current_apps_for_migrations(apps, schema_editor):
'''
This is necessary for migrations which do explicit saves on any model that
has an ImplicitRoleFIeld (which generally means anything that has
some RBAC bindings associated with it). This sets the current 'apps' that
the ImplicitRoleFIeld should be using when creating new roles.
'''
set_current_apps(apps)