- if request.post?
- 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],
- params[:trace][:description], params[:trace][:visibility])
- rescue StandardError => ex
- logger.debug ex
- end
-
- if @trace.id
- flash[:notice] = t ".trace_uploaded"
- flash[:warning] = t ".traces_waiting", :count => current_user.traces.where(:inserted => false).count if current_user.traces.where(:inserted => false).count > 4
-
- redirect_to :action => :list, :display_name => current_user.display_name
- end
- else
- @trace = Trace.new(:name => "Dummy",
- :tagstring => params[:trace][:tagstring],
- :description => params[:trace][:description],
- :visibility => params[:trace][:visibility],
- :inserted => false, :user => current_user,
- :timestamp => Time.now.getutc)
- @trace.valid?
- @trace.errors.add(:gpx_file, "can't be blank")
+ 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],
+ params[:trace][:description], params[:trace][:visibility])
+ rescue StandardError => ex
+ logger.debug ex
+ end
+
+ if @trace.id
+ flash[:notice] = t ".trace_uploaded"
+ flash[:warning] = t ".traces_waiting", :count => current_user.traces.where(:inserted => false).count if current_user.traces.where(:inserted => false).count > 4
+
+ redirect_to :action => :list, :display_name => current_user.display_name