about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-09 19:46:01 +0200
committerGitHub <noreply@github.com>2017-06-09 19:46:01 +0200
commitcdff1da901c5e649f75f9fe89e5cf17b591f049e (patch)
tree50472779a91e2adef53fbe006e6224f51a1baf53 /app/models/account.rb
parent1a065fb146752367ed9f9b75973ed9331879e437 (diff)
Correct validators so that existing error messages would look correct (#3668)
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index ac5137131..8891adb54 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -57,7 +57,8 @@ class Account < ApplicationRecord
   validates :username, uniqueness: { scope: :domain, case_sensitive: true }, if: -> { !local? && username_changed? }
 
   # Local user validations
-  validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, unreserved: true, if: -> { local? && username_changed? }
+  validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, if: -> { local? && username_changed? }
+  validates_with UnreservedUsernameValidator, if: -> { local? && username_changed? }
   validates :display_name, length: { maximum: 30 }, if: -> { local? && display_name_changed? }
   validates :note, length: { maximum: 160 }, if: -> { local? && note_changed? }