From bc400a4759d11959ae81afd8967c117209cb84ab Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 15 Jun 2016 11:14:26 +0200 Subject: [PATCH] Set state of ticket after UserInfo.current_user_id is set to have the action done as twitter user (not zammad admin). --- lib/tweet_base.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/tweet_base.rb b/lib/tweet_base.rb index 210de46fd..7fd44dc23 100644 --- a/lib/tweet_base.rb +++ b/lib/tweet_base.rb @@ -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,