2 Incheckningar 08ddad8f87 ... 66ea810d43

Upphovsman SHA1 Meddelande Datum
  TonyKurts 66ea810d43 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* 1 vecka sedan
  TonyKurts 08ddad8f87 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* 1 vecka sedan
1 ändrade filer med 6 tillägg och 5 borttagningar
  1. 6 5
      sharix_admin/signals.py

+ 6 - 5
sharix_admin/signals.py

@@ -126,9 +126,10 @@ def create_initial_ticket_lists(sender, **kwargs):
         TicketList.objects.get_or_create(pk=3401, name='Входящие технические заявки (ST_REQUEST)', group=Group.objects.get(name='PARTNER-TECHSUPPORT'))
 
 
-# Откючаем тестовых пользователей, если DEBUG=False и наоброт
-test_group = Group.objects.get(name="TEST")
-users_in_test_group = User.objects.filter(groups=test_group)
+# Откючаем тестовых пользователей (если такие есть), если DEBUG=False и наоброт
+if Group.objects.filter(name="TEST").exists():
+    test_group = Group.objects.get(name="TEST")
+    users_in_test_group = User.objects.filter(groups=test_group)
 
-if users_in_test_group:
-    users_in_test_group.update(is_active=settings.DEBUG)
+    if users_in_test_group:
+        users_in_test_group.update(is_active=settings.DEBUG)