app/controllers/katello/api/v2/repositories_controller.rb in katello-3.3.0.1 vs app/controllers/katello/api/v2/repositories_controller.rb in katello-3.3.1
- old
+ new
@@ -314,11 +314,11 @@
param :upload_ids, Array, :desc => N_("Array of upload ids to import"), :deprecated => true
param :uploads, Array, :desc => N_("Array of uploads to import") do
param 'id', String, :required => true
param 'size', String
param 'checksum', String
- param 'name', String
+ param 'name', String, :desc => N_("Needs to only be set for file repositories")
end
def import_uploads
if params['upload_ids'].empty? && params['uploads'].empty?
fail HttpErrors::BadRequest, _('No upload param specified. Either uploads or upload_ids (deprecated) is required.')
end
@@ -335,9 +335,15 @@
end
end
if params.key?(:uploads)
params[:uploads].each do |upload|
+ if @repository.file?
+ upload.except('id').except('name')
+ else
+ upload.except('id')
+ end
+
begin
sync_task(
::Actions::Katello::Repository::ImportUpload,
@repository,
upload['id'],