Commit 87bf08c9 authored by James Lopez's avatar James Lopez

fix specs

parent 3bab585b
module Emails
class CreateService < BaseService
class CreateService < ::Emails::BaseService
def execute(skip_authorization: false)
raise Gitlab::Access::AccessDeniedError unless skip_authorization || can_manage_emails?
......
module Emails
class DestroyService < BaseService
class DestroyService < ::Emails::BaseService
def execute(skip_authorization: false)
raise Gitlab::Access::AccessDeniedError unless skip_authorization || can_manage_emails?
......
......@@ -276,7 +276,7 @@ module API
email = user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
Emails::DestroyService.new(current_user, self, email: email.email).execute
Emails::DestroyService.new(current_user, user, email: email.email).execute
::Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
......@@ -510,7 +510,7 @@ module API
email = current_user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
Emails::DestroyService.new(current_user, self, email: email.email).execute
Emails::DestroyService.new(current_user, current_user, email: email.email).execute
::Users::UpdateService.new(current_user, current_user).execute do |user|
user.update_secondary_emails!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment