Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-23 12:34:07 +0300
committerJames Lopez <james@jameslopez.es>2017-06-23 12:41:43 +0300
commitb804db26485ea09dc93269898dc969ed692130a2 (patch)
tree48ac76727eed23a2815b14e8c5633bbb056f6972 /app/services/emails
parente2e0b175ae43bef44ba5fdc45b4a719aaae83422 (diff)
refactor update user service not to do auth checks
Diffstat (limited to 'app/services/emails')
-rw-r--r--app/services/emails/destroy_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/emails/destroy_service.rb b/app/services/emails/destroy_service.rb
index 94e4167d88b..2032f0dc3a9 100644
--- a/app/services/emails/destroy_service.rb
+++ b/app/services/emails/destroy_service.rb
@@ -1,13 +1,13 @@
module Emails
class DestroyService < ::Emails::BaseService
def execute
- Email.find_by_email(@email).destroy && update_secondary_emails!
+ Email.find_by_email!(@email).destroy && update_secondary_emails!
end
private
def update_secondary_emails!
- result = ::Users::UpdateService.new(@current_user, @current_user).execute do |user|
+ result = ::Users::UpdateService.new(@current_user).execute do |user|
user.update_secondary_emails!
end