Validate username. Gitlab::Regex added
This commit is contained in:
parent
5ed4e7e216
commit
47234ab367
8 changed files with 43 additions and 13 deletions
|
@ -19,7 +19,7 @@ class Namespace < ActiveRecord::Base
|
|||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
validates :path, uniqueness: true, presence: true, length: { within: 1..255 },
|
||||
format: { with: /\A[a-zA-Z][a-zA-Z0-9_\-\.]*\z/,
|
||||
format: { with: Gitlab::Regex.path_regex,
|
||||
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
|
||||
validates :owner, presence: true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue