From 82c51cc241ca990a5d7464a78e3d33c971d60f92 Mon Sep 17 00:00:00 2001 From: jctanner Date: Tue, 19 Sep 2023 08:55:22 -0400 Subject: [PATCH] Only select social accounts from github to get the github id. (#3248) * Only select social accounts from github to get the github id. No-Issue Signed-off-by: James Tanner * Lint fix. No-Issue Signed-off-by: James Tanner --------- Signed-off-by: James Tanner (cherry picked from commit b63a816a1fc307987c8f3a314b1b6407a8b1ece1) --- galaxy/api/serializers/users.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/galaxy/api/serializers/users.py b/galaxy/api/serializers/users.py index cd0ae3d0e..01c2046da 100644 --- a/galaxy/api/serializers/users.py +++ b/galaxy/api/serializers/users.py @@ -97,7 +97,9 @@ def get_summary_fields(self, obj): return d def get_github_id(self, obj): - social_user = SocialAccount.objects.filter(user_id=obj.id).first() + social_user = SocialAccount.objects.filter( + user_id=obj.id, provider='github' + ).first() if social_user is None: return None return social_user.extra_data.get('id')