Improved creation of test tickets check.

This commit is contained in:
Martin Edenhofer 2016-03-09 08:03:34 +01:00
parent ea4fa03561
commit 70bd720caf

View file

@ -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