summaryrefslogtreecommitdiff
path: root/lib/api/notification_settings.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-15 16:42:14 +0200
committerJames Lopez <james@jameslopez.es>2017-06-23 11:41:41 +0200
commitef6a4240e534f2a12dbfb45c2decd31abf9a3c26 (patch)
tree569f9055ec2e6b4761e2d4faeeaaf89a33c68482 /lib/api/notification_settings.rb
parent04bb82c8b8cb3033c805ea5158b01c09284ac3db (diff)
downloadgitlab-ce-ef6a4240e534f2a12dbfb45c2decd31abf9a3c26.tar.gz
update notification settings, fix api specs
Diffstat (limited to 'lib/api/notification_settings.rb')
-rw-r--r--lib/api/notification_settings.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/notification_settings.rb b/lib/api/notification_settings.rb
index 992ea5dc24d..5f88488ccee 100644
--- a/lib/api/notification_settings.rb
+++ b/lib/api/notification_settings.rb
@@ -34,7 +34,10 @@ module API
notification_setting.transaction do
new_notification_email = params.delete(:notification_email)
- current_user.update(notification_email: new_notification_email) if new_notification_email
+ if new_notification_email
+ ::Users::UpdateService.new(current_user, current_user, notification_email: new_notification_email).execute
+ end
+
notification_setting.update(declared_params(include_missing: false))
end
rescue ArgumentError => e # catch level enum error