Validate project creator only on create

This fixes bug when creator was removed and you cant edit project
because validation requires creator.
Signed-off-by: NDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
上级 4db2e97b
......@@ -81,7 +81,7 @@ class Project < ActiveRecord::Base
delegate :members, to: :team, prefix: true
# Validations
validates :creator, presence: true
validates :creator, presence: true, on: :create
validates :description, length: { maximum: 2000 }, allow_blank: true
validates :name, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.project_name_regex,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册