Browse Source

Improved creation of test tickets check.

Martin Edenhofer 9 years ago
parent
commit
70bd720caf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/controllers/first_steps_controller.rb

+ 2 - 2
app/controllers/first_steps_controller.rb

@@ -186,7 +186,7 @@ class FirstStepsController < ApplicationController
     )
     UserInfo.current_user_id = customer.id
     ticket = Ticket.create(
-      group_id: Group.find_by(active: true).id,
+      group_id: Group.find_by(active: true, name: 'Users').id,
       customer_id: customer.id,
       owner_id: User.find_by(login: '-').id,
       title: result[:subject],
@@ -242,7 +242,7 @@ class FirstStepsController < ApplicationController
     if !test_customer
       test_ticket_active = false
     end
-    if Group.where(active: true).count > 1
+    if Group.where(active: true, name: 'Users').count == 0
       test_ticket_active = false
     end
     return result if test_ticket_active