2 Commits 08ddad8f87 ... 66ea810d43

Autor SHA1 Nachricht Datum
  TonyKurts 66ea810d43 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* vor 1 Woche
  TonyKurts 08ddad8f87 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* vor 1 Woche
1 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen
  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)