diff options
-rw-r--r-- | app/controllers/sent_notifications_controller.rb | 2 | ||||
-rw-r--r-- | app/models/sent_notification.rb | 2 | ||||
-rw-r--r-- | app/views/layouts/notify.html.haml | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/sent_notifications_controller.rb b/app/controllers/sent_notifications_controller.rb index b7008c82bf2..7271c933b9b 100644 --- a/app/controllers/sent_notifications_controller.rb +++ b/app/controllers/sent_notifications_controller.rb @@ -3,7 +3,7 @@ class SentNotificationsController < ApplicationController def unsubscribe @sent_notification = SentNotification.for(params[:id]) - return render_404 unless @sent_notification && @sent_notification.can_unsubscribe? + return render_404 unless @sent_notification && @sent_notification.unsubscribable? noteable = @sent_notification.noteable noteable.unsubscribe(@sent_notification.recipient) diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index 03108da17be..77115597d71 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -62,7 +62,7 @@ class SentNotification < ActiveRecord::Base end end - def can_unsubscribe? + def unsubscribable? !for_commit? end diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml index 07f9be12f99..325c68c69dc 100644 --- a/app/views/layouts/notify.html.haml +++ b/app/views/layouts/notify.html.haml @@ -45,7 +45,7 @@ -# Don't link the host is the line below, one link in the email is easier to quickly click than two. You're receiving this email because of your account on #{Gitlab.config.gitlab.host}. If you'd like to receive fewer emails, you can - - if @sent_notification && @sent_notification.can_unsubscribe? + - if @sent_notification && @sent_notification.unsubscribable? = link_to "unsubscribe", unsubscribe_sent_notification_url(@sent_notification) from this thread or adjust your notification settings. |