Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix direct upload with a whitelist present that does not contain binary

Oliver Günther0ec9db6e9691
diff --git a/app/services/attachments/prepare_upload_service.rb b/app/services/attachments/prepare_upload_service.rb
index f79f0d9900b..ff9254796ab 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 516b1308f22..bd80c26f009 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 }