lib/foreman_tasks/dynflow/persistence.rb in foreman-tasks-0.9.2 vs lib/foreman_tasks/dynflow/persistence.rb in foreman-tasks-0.9.3
- old
+ new
@@ -33,10 +33,10 @@
task.update_from_dynflow(data.merge(:start_at => delayed_plan[:start_at],
:start_before => delayed_plan[:start_before]))
when :planning
task = ::ForemanTasks::Task::DynflowTask.where(:external_id => execution_plan_id).first
task.update_from_dynflow(data)
- Lock.owner!(::User.current, task.id) if ::User.current
+ Lock.owner!(::User.current, task.id) if ::User.current && ::User.current.id.present?
else
if (task = ::ForemanTasks::Task::DynflowTask.where(:external_id => execution_plan_id).first)
unless task.state.to_s == data[:state].to_s
task.update_from_dynflow(data)
end