about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-05 01:03:45 +0200
committerGitHub <noreply@github.com>2017-06-05 01:03:45 +0200
commitf7a30e2fae3199a82e2ad23bb9d761d1fe1be8de (patch)
tree5934d035c66396fd0f5cbca17baec19a9440de13 /app/models
parent3f815b2052f0528bd84fa2c856c69985876561eb (diff)
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
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 5b0d2d65c..918d5b0f1 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -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