From ba70c100f158c0e4aecedd8de43b0df0759c8e5c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 24 Aug 2010 21:32:07 +0100 Subject: [PATCH 1/1] Set the default trace visibility on the upload form --- app/controllers/trace_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 1a75ac4cc..3777621a4 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -105,7 +105,6 @@ class TraceController < ApplicationController @target_user = target_user @display_name = target_user.display_name if target_user @all_tags = tagset.values - @trace = Trace.new(:visibility => default_visibility) if @user end def mine @@ -130,6 +129,7 @@ class TraceController < ApplicationController def create if params[:trace] logger.info(params[:trace][:gpx_file].class.name) + if params[:trace][:gpx_file].respond_to?(:read) begin do_create(params[:trace][:gpx_file], params[:trace][:tagstring], @@ -158,7 +158,10 @@ class TraceController < ApplicationController @trace.valid? @trace.errors.add(:gpx_file, "can't be blank") end + else + @trace = Trace.new(:visibility => default_visibility) end + @title = t 'trace.create.upload_trace' end -- 2.39.5