X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/9d2fed811fd37577bf5cce8e8fe03d2097852428..2dc7c505fd33b2ae76ae21d871ff0fe8ce2bcdcb:/app/controllers/notes_controller.rb diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 9c6eb9457..3eb1ac3f9 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -59,16 +59,8 @@ class NotesController < ApplicationController raise OSM::APIBadUserInput.new("No text was given") if params[:text].blank? # Extract the arguments - begin - lon = Float(params[:lon]) - rescue - raise OSM::APIBadUserInput.new("lon was not a number") - end - begin - lat = Float(params[:lat]) - rescue - raise OSM::APIBadUserInput.new("lat was not a number") - end + lon = OSM.parse_float(params[:lon], OSM::APIBadUserInput, "lon was not a number") + lat = OSM.parse_float(params[:lat], OSM::APIBadUserInput, "lat was not a number") comment = params[:text] # Include in a transaction to ensure that there is always a note_comment for every note