X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ad4ab4603b27f2e89e4bb4a709bc04a6685ba67b..ca719af262380a906103e7aec9befb4c903693a1:/app/controllers/traces/icons_controller.rb?ds=inline diff --git a/app/controllers/traces/icons_controller.rb b/app/controllers/traces/icons_controller.rb index ec67a6bb1..a62e6af86 100644 --- a/app/controllers/traces/icons_controller.rb +++ b/app/controllers/traces/icons_controller.rb @@ -6,21 +6,12 @@ module Traces authorize_resource :trace def show - trace = Trace.visible.find(params[:trace_id]) + trace = Trace.visible.imported.find(params[:trace_id]) - if trace.inserted? - if trace.public? || (current_user && current_user == trace.user) - if trace.icon.attached? - redirect_to rails_blob_path(trace.icon, :disposition => "inline") - else - expires_in 7.days, :private => !trace.public?, :public => trace.public? - send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => "image/gif", :disposition => "inline") - end - else - head :forbidden - end + if trace.public? || (current_user && current_user == trace.user) + redirect_to rails_blob_path(trace.icon, :disposition => "inline") else - head :not_found + head :forbidden end rescue ActiveRecord::RecordNotFound head :not_found