2 Revīzijas 08ddad8f87 ... 66ea810d43

Autors SHA1 Ziņojums Datums
  TonyKurts 66ea810d43 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* 1 nedēļu atpakaļ
  TonyKurts 08ddad8f87 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* 1 nedēļu atpakaļ
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  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)