]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Link user names to their pages
[rails.git] / app / controllers / trace_controller.rb
index d0e70e9333f123ca03fb139114b706d18591fa4f..4b138bdaecf5d52f22c08faec64671516bda6d92 100644 (file)
@@ -30,9 +30,7 @@ class TraceController < ApplicationController
     if !display_name.blank?
       target_user = User.active.where(:display_name => display_name).first
       if target_user.nil?
-        @title = t'trace.no_such_user.title'
-        @not_found_user = display_name
-        render :action => 'no_such_user', :status => :not_found
+        render_unknown_user display_name
         return
       end
     end
@@ -187,7 +185,7 @@ class TraceController < ApplicationController
         @trace.tagstring = params[:trace][:tagstring]
         @trace.visibility = params[:trace][:visibility]
         if @trace.save
-          redirect_to :action => 'view'
+          redirect_to :action => 'view', :display_name => @user.display_name
         end
       end
     else
@@ -370,7 +368,7 @@ private
     filename = "/tmp/#{rand}"
 
     # ...and save the uploaded file to that location
-    File.open(filename, "w") { |f| f.write(file.read) }
+    File.open(filename, "wb") { |f| f.write(file.read) }
 
     # Create the trace object, falsely marked as already
     # inserted to stop the import daemon trying to load it