diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-05-02 17:26:32 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-02 17:26:32 +0200 |
commit | 49a8e5f510723eb39a948efe87e1af3b0abb49f6 (patch) | |
tree | addbccdc88b96477ea62f7e2eba25ec79c15ee99 /app/validators | |
parent | 3dd2476eb395ca706763210ef1f37978889c595d (diff) | |
download | gitlab-ce-49a8e5f510723eb39a948efe87e1af3b0abb49f6.tar.gz |
Don't validate reserved words if the format doesn't match30272-bvl-reject-more-namespaces
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.rb | 1 |
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) |