From 3ac7ff48d77d4f79f08fdad512433f279d04caa2 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 7 Jan 2018 21:08:34 +0100 Subject: [PATCH] Correction sur les migrations --- users/migrations/0066_grouppermissions.py | 113 ++++++++++++++++++++- users/migrations/0067_serveurpermission.py | 2 +- 2 files changed, 113 insertions(+), 2 deletions(-) diff --git a/users/migrations/0066_grouppermissions.py b/users/migrations/0066_grouppermissions.py index d3253e64..090bb82c 100644 --- a/users/migrations/0066_grouppermissions.py +++ b/users/migrations/0066_grouppermissions.py @@ -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") diff --git a/users/migrations/0067_serveurpermission.py b/users/migrations/0067_serveurpermission.py index e5e3380c..de4c3976 100644 --- a/users/migrations/0067_serveurpermission.py +++ b/users/migrations/0067_serveurpermission.py @@ -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: