summaryrefslogtreecommitdiff
path: root/app/controllers/profiles/emails_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-07 00:23:58 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-07 23:19:17 +0100
commit9dbd7e5aec921e43f3ea89c8e3357ca0174b0937 (patch)
treeda089409d276cb6b048c52cb91a4d74f829ffda1 /app/controllers/profiles/emails_controller.rb
parentbc57ff0ef023db3d07f1adfa6a309fb4a24ed203 (diff)
downloadgitlab-ce-9dbd7e5aec921e43f3ea89c8e3357ca0174b0937.tar.gz
Allow notification email to be set separately from primary email.
Closes #1932.
Diffstat (limited to 'app/controllers/profiles/emails_controller.rb')
-rw-r--r--app/controllers/profiles/emails_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/profiles/emails_controller.rb b/app/controllers/profiles/emails_controller.rb
index f3f0e69b83a..4a65c978e5c 100644
--- a/app/controllers/profiles/emails_controller.rb
+++ b/app/controllers/profiles/emails_controller.rb
@@ -18,6 +18,9 @@ class Profiles::EmailsController < ApplicationController
@email = current_user.emails.find(params[:id])
@email.destroy
+ current_user.set_notification_email
+ current_user.save if current_user.notification_email_changed?
+
respond_to do |format|
format.html { redirect_to profile_emails_url }
format.js { render nothing: true }