X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/765165777e2741104f7e58605b2873ed6c94a604..98b4d62462040deb0d3564808917f69cc723c3a3:/app/controllers/api/changesets_controller.rb?ds=sidebyside diff --git a/app/controllers/api/changesets_controller.rb b/app/controllers/api/changesets_controller.rb index 50cb78782..9111bb609 100644 --- a/app/controllers/api/changesets_controller.rb +++ b/app/controllers/api/changesets_controller.rb @@ -3,7 +3,6 @@ module Api class ChangesetsController < ApiController before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe] - before_action :check_api_readable, :except => [:index, :create, :update, :upload, :download, :subscribe, :unsubscribe] before_action :setup_user_auth, :only => [:show] before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe] @@ -12,8 +11,7 @@ module Api before_action :require_public_data, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe] before_action :set_request_formats, :except => [:create, :close, :upload] - around_action :api_call_handle_error - around_action :api_call_timeout, :except => [:upload] + skip_around_action :api_call_timeout, :only => [:upload] # Helper methods for checking consistency include ConsistencyValidations @@ -49,7 +47,6 @@ module Api # preload users, tags and comments, and render result @changesets = changesets.preload(:user, :changeset_tags, :comments) - render "changesets" respond_to do |format| format.xml @@ -67,7 +64,6 @@ module Api @comments = @comments.unscope(:where => :visible) if params[:show_hidden_comments].presence && can?(:restore, ChangesetComment) @comments = @comments.includes(:author) end - render "changeset" respond_to do |format| format.xml @@ -198,7 +194,7 @@ module Api check_changeset_consistency(@changeset, current_user) @changeset.update_from(new_changeset, current_user) - render "changeset" + render "show" respond_to do |format| format.xml @@ -224,7 +220,7 @@ module Api # Return a copy of the updated changeset @changeset = changeset - render "changeset" + render "show" respond_to do |format| format.xml @@ -250,7 +246,7 @@ module Api # Return a copy of the updated changeset @changeset = changeset - render "changeset" + render "show" respond_to do |format| format.xml @@ -333,7 +329,7 @@ module Api changesets.where("closed_at >= ? and created_at <= ?", from, to) else # if there is no comma, assume its a lower limit on time - changesets.where("closed_at >= ?", Time.parse(time).utc) + changesets.where(:closed_at => Time.parse(time).utc..) 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.