Commit 1f3bdd45 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Allow spaces in project name

parent 3de42718
...@@ -66,7 +66,7 @@ class Project < ActiveRecord::Base ...@@ -66,7 +66,7 @@ class Project < ActiveRecord::Base
validates :description, length: { within: 0..2000 } validates :description, length: { within: 0..2000 }
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,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter should be first" }
validates :path, presence: true, length: { within: 0..255 }, validates :path, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.path_regex, format: { with: Gitlab::Regex.path_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
end end
def project_name_regex def project_name_regex
default_regex /\A[a-zA-Z][a-zA-Z0-9_\-\. ]*\z/
end end
def path_regex def path_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