Only check locally when deduplicating usernames (#13581)

When deduplicating account usernames for OAuthable users, the routine did check if any account was known with that username, including remote accounts. This caused some unnecessary deduplication, and usernames ending with unexpected trailing _1.
This fixes #13580
lolsob-rspec
kaiyou 2020-04-30 14:39:05 +02:00 committed by GitHub
parent a30829deee
commit 7a65e2f0db
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ module Omniauthable
username = starting_username
i = 0
while Account.exists?(username: username)
while Account.exists?(username: username, domain: nil)
i += 1
username = "#{starting_username}_#{i}"
end