Skip to content

Commit

Permalink
Merge pull request #2366 from sparc-request/jl-protocol-only-epic-queue
Browse files Browse the repository at this point in the history
Jl - Protocol-only and multiple epic queue record bug
  • Loading branch information
Stuart-Johnson committed May 21, 2020
2 parents 7330d1e + 6a78c35 commit aeaf2c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/controllers/dashboard/protocols_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def update

if @protocol.update_attributes(protocol_params)
if Setting.get_value("use_epic") && @protocol.selected_for_epic && (@protocol.last_epic_push_time != nil) && Setting.get_value("queue_epic")
EpicQueue.create(protocol_id: @protocol.id, identity_id: current_user.id)
if EpicQueue.where(protocol_id: @protocol.id).size == 0
EpicQueue.create(protocol_id: @protocol.id, identity_id: current_user.id, user_change: true)
end
end

flash[:success] = I18n.t('protocols.updated', protocol_type: @protocol.type)
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/protocols_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def update
end

if Setting.get_value("use_epic") && @protocol.selected_for_epic && (@protocol.last_epic_push_time != nil) && Setting.get_value("queue_epic")
EpicQueue.create(protocol_id: @protocol.id, identity_id: current_user.id)
if EpicQueue.where(protocol_id: @protocol.id).size == 0
EpicQueue.create(protocol_id: @protocol.id, identity_id: current_user.id, user_change: true)
end
end

flash[:success] = I18n.t('protocols.updated', protocol_type: @protocol.type)
Expand Down

0 comments on commit aeaf2c7

Please sign in to comment.