diff options
author | Simon Knox <psimyn@gmail.com> | 2017-09-06 07:35:58 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-09-06 07:35:58 +0300 |
commit | b9aa55e1ea2ba226bd9bf4c6fb08fdec30e046c5 (patch) | |
tree | b7770180f178086c78ef2ca25d6bb2267f739110 /app/services/issues | |
parent | 74740604211dab6632771f1bfd7dd67902fea7ef (diff) | |
parent | d68ff7f50a93ebbff537b5e795cf6bf80bd66a6e (diff) |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ee_issue_928_backport
Diffstat (limited to 'app/services/issues')
-rw-r--r-- | app/services/issues/update_service.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb index a1f31abd164..b4ca3966505 100644 --- a/app/services/issues/update_service.rb +++ b/app/services/issues/update_service.rb @@ -6,7 +6,7 @@ module Issues handle_move_between_ids(issue) filter_spam_check_params change_issue_duplicate(issue) - update(issue) + move_issue_to_new_project(issue) || update(issue) end def before_update(issue) @@ -74,6 +74,17 @@ module Issues end end + def move_issue_to_new_project(issue) + target_project = params.delete(:target_project) + + return unless target_project && + issue.can_move?(current_user, target_project) && + target_project != issue.project + + update(issue) + Issues::MoveService.new(project, current_user).execute(issue, target_project) + end + private def get_issue_if_allowed(project, id) |