mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 10:41:45 +08:00
FIX: Check for reserved usernames before hitting DB.
This commit is contained in:
parent
57788200ec
commit
72c16967e6
|
@ -162,7 +162,7 @@ class User < ActiveRecord::Base
|
|||
|
||||
def self.username_available?(username)
|
||||
lower = username.downcase
|
||||
!User.where(username_lower: lower).exists? && !reserved_username?(lower)
|
||||
!reserved_username?(lower) && !User.where(username_lower: lower).exists?
|
||||
end
|
||||
|
||||
def self.reserved_username?(username)
|
||||
|
|
Loading…
Reference in New Issue
Block a user