2 Commits 08ddad8f87 ... 66ea810d43

Autor SHA1 Mensaje Fecha
  TonyKurts 66ea810d43 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* hace 1 semana
  TonyKurts 08ddad8f87 Added possibility of automatic generation of test users during project installation and upgrade using *bin/install.sh* hace 1 semana
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  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)