From 6297446d1773c95d86ecd31f591e1829b431f378 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Thu, 1 Mar 2018 11:32:39 -0300 Subject: Move wip handling to MergeRequest::BaseService --- app/services/quick_actions/interpret_service.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/services/quick_actions') diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index 1e9bd84e749..cba49faac31 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -347,9 +347,9 @@ module QuickActions "#{verb} this #{noun} as Work In Progress." end condition do - issuable.persisted? && - issuable.respond_to?(:work_in_progress?) && - current_user.can?(:"update_#{issuable.to_ability_name}", issuable) + issuable.respond_to?(:work_in_progress?) && + # Allow it to mark as WIP on MR creation page _or_ through MR notes. + (issuable.new_record? || current_user.can?(:"update_#{issuable.to_ability_name}", issuable)) end command :wip do @updates[:wip_event] = issuable.work_in_progress? ? 'unwip' : 'wip' -- cgit v1.2.3