Repository navigation
fix(accounts): don't crash Steam login when several users share a steamid - #770
Merged
Merged
Conversation
…amid pre_social_login looked up the user with User.objects.get(steamid=...), which raised MultipleObjectsReturned on /accounts/steam/callback/ when more than one account carries the same steamid. Skip auto-connecting in that case, as is already done for duplicate emails. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production error report on 2026-10-06:
MultipleObjectsReturned at /accounts/steam/callback/: get() returned more than one User -- it returned more than 20!(from
accounts/allauth_adapter.py,pre_social_login)LutrisSocialAccountAdapter.pre_social_loginmatches Steam logins to existing users withUser.objects.get(steamid=uid). When several accounts carry the samesteamid, the Steam callback returns a 500. This PR handlesMultipleObjectsReturnedthe same way the email branch already does: log a warning and skip auto-connect.Note: more than 20 accounts share the SteamID from that report, which may be worth a look for spam or multi-accounting.
Tests: new
TestSteamSocialLogincovers connecting a single matching user and handling a duplicate steamid. The duplicate test errors without the fix. The full suite passes (168 tests, CI settings), as doruff checkandruff format --check.🤖 Generated with Claude Code