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)