Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
namespace: don't be so cryptic on the format
Browse files Browse the repository at this point in the history
bsc#978661
bnc#978661

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
  • Loading branch information
mssola committed May 6, 2016
1 parent d869e2b commit 2cc3ea0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/validators/namespace_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class NamespaceValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
# Already validated by the presence validator.
return if value.nil?
record.errors[attribute] << "Namespace name must match #{NAME_REGEXP}" if value !~ NAME_REGEXP

if value !~ NAME_REGEXP
record.errors[attribute] << "can only contain lower case alphanumeric "\
"characters, with optional underscores and dashes in the middle."
end
end
end

0 comments on commit 2cc3ea0

Please sign in to comment.