0
0
Fork 0

Added support for configurable reserved usernames (fix of #1382) (#3566)

* Added support for configurable reserved usernames

* Added reserved usernames from mastodon issue 1355

* Fix reserved usernames
This commit is contained in:
Eugen Rochko 2017-06-05 01:03:45 +02:00 committed by GitHub
parent 3f815b2052
commit f7a30e2fae
5 changed files with 31 additions and 2 deletions

View file

@ -56,7 +56,7 @@ class Account < ApplicationRecord
# Local user validations
with_options if: :local? do
validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }
validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, unreserved: true
validates :display_name, length: { maximum: 30 }
validates :note, length: { maximum: 160 }
end