summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-01-09 19:32:03 +0100
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-01-09 19:32:03 +0100
commit26cedc7e0bd83fc488da3a4dc5265d395639215f (patch)
treed50a46a486267e84ff112d4745c89757be1b6d49 /app/controllers
parent36d858bcf98868426256ce51a28e7029b38e0c2d (diff)
downloadgitlab-ce-26cedc7e0bd83fc488da3a4dc5265d395639215f.tar.gz
Minor improvements, unsubscribe from email footer
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sent_notifications_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/sent_notifications_controller.rb b/app/controllers/sent_notifications_controller.rb
index 93dcc16094f..b7008c82bf2 100644
--- a/app/controllers/sent_notifications_controller.rb
+++ b/app/controllers/sent_notifications_controller.rb
@@ -3,14 +3,14 @@ class SentNotificationsController < ApplicationController
def unsubscribe
@sent_notification = SentNotification.for(params[:id])
- return render_404 unless @sent_notification && !@sent_notification.for_commit?
+ return render_404 unless @sent_notification && @sent_notification.can_unsubscribe?
noteable = @sent_notification.noteable
noteable.unsubscribe(@sent_notification.recipient)
flash[:notice] = "You have been unsubscribed from this thread."
if current_user
- case @sent_notification.noteable
+ case noteable
when Issue
redirect_to issue_path(noteable)
when MergeRequest