Commit 1f3bdd453e8dfb81b97166ede481685d85ea04c6

Authored by Dmitriy Zaporozhets
1 parent 3de42718

Allow spaces in project name

Showing 2 changed files with 2 additions and 2 deletions   Show diff stats
app/models/project.rb
@@ -66,7 +66,7 @@ class Project < ActiveRecord::Base @@ -66,7 +66,7 @@ class Project < ActiveRecord::Base
66 validates :description, length: { within: 0..2000 } 66 validates :description, length: { within: 0..2000 }
67 validates :name, presence: true, length: { within: 0..255 }, 67 validates :name, presence: true, length: { within: 0..255 },
68 format: { with: Gitlab::Regex.project_name_regex, 68 format: { with: Gitlab::Regex.project_name_regex,
69 - message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } 69 + message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter should be first" }
70 validates :path, presence: true, length: { within: 0..255 }, 70 validates :path, presence: true, length: { within: 0..255 },
71 format: { with: Gitlab::Regex.path_regex, 71 format: { with: Gitlab::Regex.path_regex,
72 message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } 72 message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
lib/gitlab/regex.rb
@@ -7,7 +7,7 @@ module Gitlab @@ -7,7 +7,7 @@ module Gitlab
7 end 7 end
8 8
9 def project_name_regex 9 def project_name_regex
10 - default_regex 10 + /\A[a-zA-Z][a-zA-Z0-9_\-\. ]*\z/
11 end 11 end
12 12
13 def path_regex 13 def path_regex