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

Skip double validation when container present

Oliver Güntherbf30ad0d98e7
diff --git a/app/contracts/attachments/create_contract.rb b/app/contracts/attachments/create_contract.rb
index 77e1a074ce4..b7d8aad91b9 100644
--- a/app/contracts/attachments/create_contract.rb
+++ b/app/contracts/attachments/create_contract.rb
@@ -49,6 +49,8 @@ module Attachments
private
def validate_attachments_addable
+ return if model.container
+
if Redmine::Acts::Attachable.attachables.none?(&:attachments_addable?)
errors.add(:base, :error_unauthorized)
end