Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-05-02 18:26:32 +0300
committerBob Van Landuyt <bob@gitlab.com>2017-05-02 18:26:32 +0300
commit49a8e5f510723eb39a948efe87e1af3b0abb49f6 (patch)
treeaddbccdc88b96477ea62f7e2eba25ec79c15ee99 /app/validators
parent3dd2476eb395ca706763210ef1f37978889c595d (diff)
Don't validate reserved words if the format doesn't match
Because it also won't match the sophisticated format we have for detecting reserved names. We don't want to confuse the user with 2 error messages
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/dynamic_path_validator.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/validators/dynamic_path_validator.rb b/app/validators/dynamic_path_validator.rb
index 7a14aed0c3e..226eb6b313c 100644
--- a/app/validators/dynamic_path_validator.rb
+++ b/app/validators/dynamic_path_validator.rb
@@ -198,6 +198,7 @@ class DynamicPathValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
unless value =~ Gitlab::Regex.namespace_regex
record.errors.add(attribute, Gitlab::Regex.namespace_regex_message)
+ return
end
if path_reserved_for_record?(record, value)