Prevent conflicts in COF perm migration
There may be a conflict during the migration cof 0009 if the permissions are referenced only by their codename.
This commit is contained in:
parent
d36d69238d
commit
c81b849785
1 changed files with 8 additions and 2 deletions
|
@ -30,8 +30,14 @@ def preserve_perms(apps, schema_editor):
|
|||
apps.models_module = None
|
||||
|
||||
CofProfile = apps.get_model("cof", "CofProfile")
|
||||
memberp = Permission.objects.get(codename='member')
|
||||
burop = Permission.objects.get(codename='buro')
|
||||
memberp = Permission.objects.get(
|
||||
codename='member',
|
||||
content_type__app_label="cof"
|
||||
)
|
||||
burop = Permission.objects.get(
|
||||
codename='buro',
|
||||
content_type__app_label="cof"
|
||||
)
|
||||
|
||||
# creates the groups for COF members and
|
||||
member = Group.objects.create(name='cof_members')
|
||||
|
|
Loading…
Reference in a new issue