mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-26 00:43:46 +00:00
Merge branch 'fix_initial_migration' into 'master'
Fix problèmes sur les migrations See merge request federez/re2o!65
This commit is contained in:
commit
96070d2b3c
2 changed files with 4 additions and 3 deletions
|
@ -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,6 +17,7 @@ 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()
|
||||||
|
if rg:
|
||||||
rg.critical=True
|
rg.critical=True
|
||||||
rg.save()
|
rg.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue