Jelajahi Sumber

Each automatically created group now has a conceptually unique identifier

TonyKurts 11 bulan lalu
induk
melakukan
f11a285ceb
1 mengubah file dengan 11 tambahan dan 11 penghapusan
  1. 11 11
      SharixAdmin/groups.py

+ 11 - 11
SharixAdmin/groups.py

@@ -6,17 +6,17 @@ from django.contrib.auth.decorators import user_passes_test
 #Создание групп
 @receiver(post_migrate)
 def create_groups(sender, **kwargs):
-    Group.objects.get_or_create(name='METASERVICE-ADMIN')
-    Group.objects.get_or_create(name='METASERVICE-SUPERVISOR')
-    Group.objects.get_or_create(name='METASERVICE-SUPPORT')
-    Group.objects.get_or_create(name='METASERVICE-TECHSUPPORT')
-    Group.objects.get_or_create(name='PARTNER-ADMIN')
-    Group.objects.get_or_create(name='PARTNER-SUPERVISOR')
-    Group.objects.get_or_create(name='PARTNER-TECHSUPPORT')
-    Group.objects.get_or_create(name='PARTNER-SUPPORT')
-    Group.objects.get_or_create(name='GUEST')
-    Group.objects.get_or_create(name='CLIENT')
-    Group.objects.get_or_create(name='PROVIDER')
+    Group.objects.get_or_create(pk=11, name='METASERVICE-ADMIN')
+    Group.objects.get_or_create(pk=12, name='METASERVICE-SUPERVISOR')
+    Group.objects.get_or_create(pk=13, name='METASERVICE-SUPPORT')
+    Group.objects.get_or_create(pk=14, name='METASERVICE-TECHSUPPORT')
+    Group.objects.get_or_create(pk=21, name='PARTNER-ADMIN')
+    Group.objects.get_or_create(pk=22, name='PARTNER-SUPERVISOR')
+    Group.objects.get_or_create(pk=23, name='PARTNER-SUPPORT')
+    Group.objects.get_or_create(pk=24, name='PARTNER-TECHSUPPORT')
+    Group.objects.get_or_create(pk=31, name='PROVIDER')
+    Group.objects.get_or_create(pk=41, name='CLIENT')
+    Group.objects.get_or_create(pk=51, name='GUEST')