diff --git a/app/controllers/email_controller.rb b/app/controllers/email_controller.rb index 99b70876f79..600e6ceb3a8 100644 --- a/app/controllers/email_controller.rb +++ b/app/controllers/email_controller.rb @@ -110,7 +110,6 @@ class EmailController < ApplicationController def unsubscribed @email = params[:email] - raise Discourse::NotFound if !User.find_by_email(params[:email]) @topic = Topic.find_by(id: params[:topic_id].to_i) if params[:topic_id] end diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index 52fa3633150..2866ff2dcbf 100644 --- a/app/controllers/invites_controller.rb +++ b/app/controllers/invites_controller.rb @@ -96,7 +96,6 @@ class InvitesController < ApplicationController guardian.ensure_can_invite_to_forum!(groups) topic = Topic.find_by(id: params[:topic_id]) - guardian.ensure_can_see_topic?(topic) group_ids = groups.map(&:id) invite_exists = Invite.where(email: params[:email], invited_by_id: current_user.id).first diff --git a/app/views/email/unsubscribed.html.erb b/app/views/email/unsubscribed.html.erb index 835b2c052f0..a593bfed31b 100644 --- a/app/views/email/unsubscribed.html.erb +++ b/app/views/email/unsubscribed.html.erb @@ -3,12 +3,12 @@

<%=t "unsubscribed.title"%>


- <%= t("unsubscribed.description", email: @email, url: path("/my/preferences")).html_safe %> + <%=t("unsubscribed.description", email: @email, url: path("/my/preferences")).html_safe %>

<% if @topic %>

- <%= t("unsubscribed.topic_description", link: render_topic_title(@topic)).html_safe%> + <%=t("unsubscribed.topic_description", link: render_topic_title(@topic)).html_safe%>

<% end %> diff --git a/spec/requests/email_controller_spec.rb b/spec/requests/email_controller_spec.rb deleted file mode 100644 index cd059019154..00000000000 --- a/spec/requests/email_controller_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rails_helper' - -RSpec.describe EmailController do - describe '#unsubscribed' do - describe 'when email is invalid' do - it 'should return the right response' do - get '/email/unsubscribed', params: { email: 'somerandomstring' } - - expect(response.status).to eq(404) - end - end - end -end