Set state of ticket after UserInfo.current_user_id is set to have the action done as twitter user (not zammad admin).

This commit is contained in:
Martin Edenhofer 2016-06-15 11:14:26 +02:00
parent f6a9144086
commit bc400a4759

View file

@ -146,12 +146,6 @@ class TweetBase
Rails.logger.debug user.inspect
Rails.logger.debug ticket.inspect
# set ticket state to open if not new
if ticket.state.name != 'new'
ticket.state = Ticket::State.find_by(name: 'open')
ticket.save
end
# import tweet
to = nil
from = nil
@ -181,6 +175,12 @@ class TweetBase
UserInfo.current_user_id = user.id
# set ticket state to open if not new
if ticket.state.name != 'new'
ticket.state = Ticket::State.find_by(name: 'open')
ticket.save
end
Ticket::Article.create(
from: from,
to: to,