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

Add presence check to filename

Oliver Günther7f1b777d4579
diff --git a/app/contracts/attachments/create_contract.rb b/app/contracts/attachments/create_contract.rb
index f7eed10e0b4..77e1a074ce4 100644
--- a/app/contracts/attachments/create_contract.rb
+++ b/app/contracts/attachments/create_contract.rb
@@ -40,6 +40,8 @@ module Attachments
attribute :container_type
attribute :author
+ validates :filename, presence: true
+
validate :validate_attachments_addable
validate :validate_container_addable
validate :validate_author