Browse Source

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
master
kaiyou 4 years ago
committed by GitHub
parent
commit
3511528e50
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/models/concerns/omniauthable.rb

+ 1
- 1
app/models/concerns/omniauthable.rb 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

Loading…
Cancel
Save