Commit 35c4351e2b5165dd9dc31ec625d7bb21821781c3
1 parent
4db2e97b
Exists in
master
and in
4 other branches
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: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/project.rb
@@ -81,7 +81,7 @@ class Project < ActiveRecord::Base | @@ -81,7 +81,7 @@ class Project < ActiveRecord::Base | ||
81 | delegate :members, to: :team, prefix: true | 81 | delegate :members, to: :team, prefix: true |
82 | 82 | ||
83 | # Validations | 83 | # Validations |
84 | - validates :creator, presence: true | 84 | + validates :creator, presence: true, on: :create |
85 | validates :description, length: { maximum: 2000 }, allow_blank: true | 85 | validates :description, length: { maximum: 2000 }, allow_blank: true |
86 | validates :name, presence: true, length: { within: 0..255 }, | 86 | validates :name, presence: true, length: { within: 0..255 }, |
87 | format: { with: Gitlab::Regex.project_name_regex, | 87 | format: { with: Gitlab::Regex.project_name_regex, |