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:
parent
f6a9144086
commit
bc400a4759
1 changed files with 6 additions and 6 deletions
|
@ -146,12 +146,6 @@ class TweetBase
|
||||||
Rails.logger.debug user.inspect
|
Rails.logger.debug user.inspect
|
||||||
Rails.logger.debug ticket.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
|
# import tweet
|
||||||
to = nil
|
to = nil
|
||||||
from = nil
|
from = nil
|
||||||
|
@ -181,6 +175,12 @@ class TweetBase
|
||||||
|
|
||||||
UserInfo.current_user_id = user.id
|
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(
|
Ticket::Article.create(
|
||||||
from: from,
|
from: from,
|
||||||
to: to,
|
to: to,
|
||||||
|
|
Loading…
Reference in a new issue