Skip to content
Snippets Groups Projects
Commit 49a8e5f5 authored by Bob Van Landuyt :neckbeard:'s avatar Bob Van Landuyt :neckbeard: :sunglasses:
Browse files

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
parent 3dd2476e
No related branches found
No related tags found
No related merge requests found
Loading
@@ -198,6 +198,7 @@ class DynamicPathValidator < ActiveModel::EachValidator
Loading
@@ -198,6 +198,7 @@ class DynamicPathValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
unless value =~ Gitlab::Regex.namespace_regex unless value =~ Gitlab::Regex.namespace_regex
record.errors.add(attribute, Gitlab::Regex.namespace_regex_message) record.errors.add(attribute, Gitlab::Regex.namespace_regex_message)
return
end end
   
if path_reserved_for_record?(record, value) if path_reserved_for_record?(record, value)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment