diff --git a/app/models/user.rb b/app/models/user.rb index 8b1d540a1e1..6ce645d43d3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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)