diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-07 16:17:12 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-07 16:57:26 -0500 |
commit | 9321d382bd5a0697e0e15a5065ec274e75541851 (patch) | |
tree | 98c24ffe03b2bbd5212935ec7680d1bb1f122ec1 /app/models/user.rb | |
parent | ad6a771dc680b52e4b46c73f20bc39340d08bf32 (diff) | |
download | gitlab-ce-9321d382bd5a0697e0e15a5065ec274e75541851.tar.gz |
Add custom NamespaceValidator
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 719b49b16fe..cfed797e725 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -148,11 +148,9 @@ class User < ActiveRecord::Base validates :bio, length: { maximum: 255 }, allow_blank: true validates :projects_limit, presence: true, numericality: { greater_than_or_equal_to: 0 } validates :username, + namespace: true, presence: true, - uniqueness: { case_sensitive: false }, - exclusion: { in: Gitlab::Blacklist.path }, - format: { with: Gitlab::Regex.namespace_regex, - message: Gitlab::Regex.namespace_regex_message } + uniqueness: { case_sensitive: false } validates :notification_level, inclusion: { in: Notification.notification_levels }, presence: true validate :namespace_uniq, if: ->(user) { user.username_changed? } |