Commit 35c4351e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4db2e97b
...@@ -81,7 +81,7 @@ class Project < ActiveRecord::Base ...@@ -81,7 +81,7 @@ class Project < ActiveRecord::Base
delegate :members, to: :team, prefix: true delegate :members, to: :team, prefix: true
# Validations # Validations
validates :creator, presence: true validates :creator, presence: true, on: :create
validates :description, length: { maximum: 2000 }, allow_blank: true validates :description, length: { maximum: 2000 }, allow_blank: true
validates :name, presence: true, length: { within: 0..255 }, validates :name, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.project_name_regex, format: { with: Gitlab::Regex.project_name_regex,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment