This instance will be upgraded to Heptapod 0.27.1 on 2021-12-08 at 22:00 UTC+1 (a few minutes of down time)

Commit 17ea019f authored by Andrey Kumanyaev's avatar Andrey Kumanyaev
Browse files

Add Project name validation

parent 6723cd2bfe02
......@@ -64,7 +64,9 @@ class TransferError < StandardError; end
# Validations
validates :owner, presence: true
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,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
validates :path, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.path_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
......
......@@ -6,6 +6,10 @@ def username_regex
default_regex
end
def project_name_regex
default_regex
end
def path_regex
default_regex
end
......
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