8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Correction sur les migrations

This commit is contained in:
Gabriel Detraz 2018-01-07 21:08:34 +01:00 committed by root
parent 234aa26319
commit 3b2256c283
2 changed files with 113 additions and 2 deletions

View file

@ -223,7 +223,118 @@ class Migration(migrations.Migration):
'change_services',
'delete_service',
'delete_services',
'view_service']}
'view_service'],
'infra': ['add_domain',
'change_domain',
'delete_domain',
'view_domain',
'add_extension',
'change_extension',
'delete_extension',
'use_all_extension',
'view_extension',
'add_interface',
'change_interface',
'delete_interface',
'view_interface',
'add_iplist',
'change_iplist',
'delete_iplist',
'view_iplist',
'add_iptype',
'change_iptype',
'delete_iptype',
'use_all_iptype',
'view_iptype',
'add_machine',
'change_machine',
'change_machine_user',
'delete_machine',
'view_machine',
'add_machinetype',
'change_machinetype',
'delete_machinetype',
'use_all_machinetype',
'view_machinetype',
'add_mx',
'change_mx',
'delete_mx',
'view_mx',
'add_nas',
'change_nas',
'delete_nas',
'view_nas',
'add_ns',
'change_ns',
'delete_ns',
'view_ns',
'add_ouvertureport',
'change_ouvertureport',
'delete_ouvertureport',
'add_ouvertureportlist',
'change_ouvertureportlist',
'delete_ouvertureportlist',
'view_ouvertureportlist',
'add_service',
'change_service',
'delete_service',
'view_service',
'add_service_link',
'change_service_link',
'delete_service_link',
'add_soa',
'change_soa',
'delete_soa',
'view_soa',
'add_srv',
'change_srv',
'delete_srv',
'view_soa',
'add_text',
'add_txt',
'change_text',
'change_txt',
'delete_text',
'delete_txt',
'view_txt',
'add_vlan',
'change_vlan',
'delete_vlan',
'view_vlan',
'add_constructorswitch',
'change_constructorswitch',
'delete_constructorswitch',
'view_constructorswitch',
'add_modelswitch',
'change_modelswitch',
'delete_modelswitch',
'view_modelswitch',
'add_port',
'change_port',
'delete_port',
'view_port',
'add_room',
'change_room',
'delete_room',
'view_room',
'add_stack',
'change_stack',
'delete_stack',
'view_stack',
'add_switch',
'change_switch',
'delete_switch',
'view_switch',
'add_listshell',
'change_listshell',
'delete_listshell',
'add_serviceuser',
'change_serviceuser',
'delete_serviceuser',
'view_serviceuser',
'change_user',
'view_user']}
rights = apps.get_model("users", "ListRight")
permissions = apps.get_model("auth", "Permission")

View file

@ -23,7 +23,7 @@ class Migration(migrations.Migration):
perm = permissions.objects.using(db_alias).create(
codename='serveur',
name='Serveur',
content_type=contenttype.objects.using(db_alias).get_for_model(machine)
content_type=contenttype.objects.using(db_alias).filter(model='machine').first()
)
group_object = rights.objects.using(db_alias).filter(unix_name='serveur').first()
if not group_object: