summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <brett@digitalmoksha.com>2017-09-13 14:47:09 +0200
committerBrett Walker <brett@digitalmoksha.com>2017-09-23 15:24:53 +0200
commitb2d53791614da093a32fd7040371cf2054aa9817 (patch)
treea1ca7b4655823e70f0ba35aae3cecfa15f230590
parent09726bdf446b4673d4f92bc9132a6e34f3a67160 (diff)
downloadgitlab-ce-b2d53791614da093a32fd7040371cf2054aa9817.tar.gz
fix calls to Emails::DestroyService
-rw-r--r--app/controllers/admin/users_controller.rb2
-rw-r--r--lib/api/users.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index cbcef70e957..abf03622b17 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -155,7 +155,7 @@ class Admin::UsersController < Admin::ApplicationController
def remove_email
email = user.emails.find(params[:email_id])
- success = Emails::DestroyService.new(user, email: email.email).execute
+ success = Emails::DestroyService.new(user).execute(email)
respond_to do |format|
if success
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 8b44639dd7d..992556c838b 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -366,7 +366,7 @@ module API
not_found!('Email') unless email
destroy_conditionally!(email) do |email|
- Emails::DestroyService.new(current_user, email: email.email).execute
+ Emails::DestroyService.new(current_user).execute(email)
end
user.update_secondary_emails!
@@ -689,7 +689,7 @@ module API
not_found!('Email') unless email
destroy_conditionally!(email) do |email|
- Emails::DestroyService.new(current_user, email: email.email).execute
+ Emails::DestroyService.new(current_user).execute(email)
end
current_user.update_secondary_emails!