Commit 410f92c2 authored by Gabriel Detraz's avatar Gabriel Detraz

Fix problèmes sur les migrations

parent 61b16980
...@@ -23,7 +23,7 @@ class Migration(migrations.Migration): ...@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
perm = permissions.objects.using(db_alias).create( perm = permissions.objects.using(db_alias).create(
codename='serveur', codename='serveur',
name='Serveur', name='Serveur',
content_type=contenttype.objects.using(db_alias).filter(model='machine').first() content_type=contenttype.objects.get_for_model(machine)
) )
group_object = rights.objects.using(db_alias).filter(unix_name='serveur').first() group_object = rights.objects.using(db_alias).filter(unix_name='serveur').first()
if not group_object: if not group_object:
......
...@@ -17,8 +17,9 @@ class Migration(migrations.Migration): ...@@ -17,8 +17,9 @@ class Migration(migrations.Migration):
rights = apps.get_model("users", "ListRight") rights = apps.get_model("users", "ListRight")
for right in critical_rights: for right in critical_rights:
rg = rights.objects.using(db_alias).filter(unix_name=right).first() rg = rights.objects.using(db_alias).filter(unix_name=right).first()
rg.critical=True if rg:
rg.save() rg.critical=True
rg.save()
def untransfer_permissions(apps, schema_editor): def untransfer_permissions(apps, schema_editor):
return return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment