From dd1a1849553f8df4aab44c4655633665d9b98abf Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jun 2016 11:57:23 +1000 Subject: [PATCH] Correct mailing list mode unsubscribe --- app/controllers/email_controller.rb | 3 ++- app/views/email/unsubscribe.html.erb | 2 +- spec/controllers/email_controller_spec.rb | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/email_controller.rb b/app/controllers/email_controller.rb index bcc8041b65f..37b169a235d 100644 --- a/app/controllers/email_controller.rb +++ b/app/controllers/email_controller.rb @@ -43,6 +43,7 @@ class EmailController < ApplicationController if @user.blank? @not_found = true end + end def perform_unsubscribe @@ -87,7 +88,7 @@ class EmailController < ApplicationController end if params["disable_mailing_list"] - user.user_option.update_columns(email_always: false) + user.user_option.update_columns(mailing_list_mode: false) updated = true end diff --git a/app/views/email/unsubscribe.html.erb b/app/views/email/unsubscribe.html.erb index b2df6ad2c87..b4d543a16b6 100644 --- a/app/views/email/unsubscribe.html.erb +++ b/app/views/email/unsubscribe.html.erb @@ -43,7 +43,7 @@ <% end %> <% end %> - <% if @user.user_option.email_always && !SiteSetting.disable_mailing_list_mode %> + <% if @user.user_option.mailing_list_mode && !SiteSetting.disable_mailing_list_mode %>