diff --git a/app/services/attachments/prepare_upload_service.rb b/app/services/attachments/prepare_upload_service.rb index f79f0d9900..ff9254796a 100644 --- a/app/services/attachments/prepare_upload_service.rb +++ b/app/services/attachments/prepare_upload_service.rb @@ -27,7 +27,7 @@ #++ module Attachments - class PrepareUploadService < ::BaseServices::Create + class PrepareUploadService < BaseService def persist(call) attachment = call.result diff --git a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb index 516b1308f2..bd80c26f00 100644 --- a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb +++ b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb @@ -78,8 +78,8 @@ module Bim attachment = Attachment.pending_direct_uploads.where(id: id).first if attachment.nil? # this should not happen flash[:error] = "Direct upload failed." - redirect_to action: :new + return end params = { @@ -179,7 +179,7 @@ module Bim return unless OpenProject::Configuration.direct_uploads? call = ::Attachments::PrepareUploadService - .new(user: current_user) + .bypass_whitelist(user: current_user) .call(filename: "model.ifc", filesize: 0) call.on_failure { flash[:error] = call.message }