From: Lucas Di Pentima Date: Tue, 4 Jun 2019 23:34:21 +0000 (-0300) Subject: 15306: Fixes the bug. X-Git-Tag: 2.0.0~314^2~7 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/b3d5254ce24ca82904b13d61012b2d8d676a30d8 15306: Fixes the bug. The problem was coming from 2 sides: 1) The collections#show action didn't have the required parameters definitions. 2) The load_required_parameters callback was being called after the object lookup callback. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index 89eabdcee2..40c7a8abf2 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -42,9 +42,9 @@ class ApplicationController < ActionController::Base before_action :require_auth_scope, except: ERROR_ACTIONS before_action :catch_redirect_hint + before_action :load_required_parameters before_action(:find_object_by_uuid, except: [:index, :create] + ERROR_ACTIONS) - before_action :load_required_parameters before_action :load_limit_offset_order_params, only: [:index, :contents] before_action :load_where_param, only: [:index, :contents] before_action :load_filters_param, only: [:index, :contents] diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb index 5d7a7ae266..7c7953ac9b 100644 --- a/services/api/app/controllers/arvados/v1/collections_controller.rb +++ b/services/api/app/controllers/arvados/v1/collections_controller.rb @@ -21,6 +21,18 @@ class Arvados::V1::CollectionsController < ApplicationController }) end + def self._show_requires_parameters + (super rescue {}). + merge({ + include_trash: { + type: 'boolean', required: false, description: "Include collections whose is_trashed attribute is true." + }, + include_old_versions: { + type: 'boolean', required: false, description: "Include past collection versions." + }, + }) + end + def create if resource_attrs[:uuid] and (loc = Keep::Locator.parse(resource_attrs[:uuid])) resource_attrs[:portable_data_hash] = loc.to_s