]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/traces/pictures_controller.rb
Merge remote-tracking branch 'upstream/pull/5391'
[rails.git] / app / controllers / traces / pictures_controller.rb
index 0e0d588cb7410a8c781d41380f0fa316fc039fbb..0b26ed8847f37d0507de5d1870e67331119e8525 100644 (file)
@@ -6,21 +6,12 @@ module Traces
     authorize_resource :trace
 
     def show
     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.image, :disposition => "inline")
-          else
-            expires_in 7.days, :private => !trace.public?, :public => trace.public?
-            send_file(trace.large_picture_name, :filename => "#{trace.id}.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.image, :disposition => "inline")
       else
       else
-        head :not_found
+        head :forbidden
       end
     rescue ActiveRecord::RecordNotFound
       head :not_found
       end
     rescue ActiveRecord::RecordNotFound
       head :not_found