X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6a68e7676d950661edf24e572ee6ba302b9b3cc4..d15041f84713e60eb28a6e22fadfd80ab3cd76b0:/app/controllers/api/changesets_controller.rb diff --git a/app/controllers/api/changesets_controller.rb b/app/controllers/api/changesets_controller.rb index 316015228..29a57570d 100644 --- a/app/controllers/api/changesets_controller.rb +++ b/app/controllers/api/changesets_controller.rb @@ -2,7 +2,6 @@ module Api class ChangesetsController < ApiController - layout "site" require "xml/libxml" before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe] @@ -22,7 +21,7 @@ module Api def create assert_method :put - cs = Changeset.from_xml(request.raw_post, true) + cs = Changeset.from_xml(request.raw_post, :create => true) # Assume that Changeset.from_xml has thrown an exception if there is an error parsing the xml cs.user = current_user @@ -320,9 +319,7 @@ module Api end # stupid Time seems to throw both of these for bad parsing, so # we have to catch both and ensure the correct code path is taken. - rescue ArgumentError => e - raise OSM::APIBadUserInput, e.message.to_s - rescue RuntimeError => e + rescue ArgumentError, RuntimeError => e raise OSM::APIBadUserInput, e.message.to_s end