about summary refs log tree commit diff
path: root/app/validators
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-07-24 16:23:53 +0200
committerThibaut Girka <thib@sitedethib.com>2019-07-24 16:23:53 +0200
commit2d35e4460a6c55930568d4b19563f9894d89e79b (patch)
tree020d6a6ef6b4a236f14d6287e4ff97c0750db3c9 /app/validators
parente3a551cbd1f894fa779dc55168e56bb5f07b3d72 (diff)
parent94f5c714f11248df6a2b793f47cdb30028f67fca (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/unique_username_validator.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/validators/unique_username_validator.rb b/app/validators/unique_username_validator.rb
index fb67105dd..4e24e3f5f 100644
--- a/app/validators/unique_username_validator.rb
+++ b/app/validators/unique_username_validator.rb
@@ -1,10 +1,12 @@
 # frozen_string_literal: true
 
+# See also: USERNAME_RE in the Account class
+
 class UniqueUsernameValidator < ActiveModel::Validator
   def validate(account)
     return if account.username.nil?
 
-    normalized_username = account.username.downcase.delete('.')
+    normalized_username = account.username.downcase
 
     scope = Account.where(domain: nil).where('lower(username) = ?', normalized_username)
     scope = scope.where.not(id: account.id) if account.persisted?