Skip to content

Commit

Permalink
fixup! Add attachment prominence checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Sep 29, 2022
1 parent bffa359 commit 981abb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 1 addition & 4 deletions app/controllers/attachments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ def authenticate_attachment
if @attachment
if cannot?(:read, @attachment)
request.format = :html
render_hidden(
'request/hidden_attachment',
locals: { attachment: @attachment }
)
render_hidden('request/hidden_attachment')
end
elsif params[:file_name]
# If we can't find the right attachment, redirect to the incoming message:
Expand Down
11 changes: 4 additions & 7 deletions app/views/request/hidden_attachment.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<%- if !attachment.prominence_reason.blank? %>
<%= _('This attachment has been hidden.') %>
<%= attachment.prominence_reason %>
<%- else %>
<%= _("This attachment has been hidden. There are various reasons why we " \
"might have done this, sorry we can't be more specific here.") %>
<%- end %>
<% @title = _('Attachment has been removed') %>

<h1><%= @title %></h1>
<%= render partial: 'request/hidden_attachment', locals: { attachment: @attachment } %>

0 comments on commit 981abb8

Please sign in to comment.