From ac9f04802cbe48e0f52415db0e585b7352ad1a1a Mon Sep 17 00:00:00 2001 From: James Tanner Date: Tue, 19 Sep 2023 08:18:21 -0400 Subject: [PATCH 1/2] Only select social accounts from github to get the github id. No-Issue Signed-off-by: James Tanner --- galaxy/api/serializers/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy/api/serializers/users.py b/galaxy/api/serializers/users.py index cd0ae3d0e..5c911b4f5 100644 --- a/galaxy/api/serializers/users.py +++ b/galaxy/api/serializers/users.py @@ -97,7 +97,7 @@ 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') From c5ead07b47a31df91778bad169fe1123938a1f6a Mon Sep 17 00:00:00 2001 From: James Tanner Date: Tue, 19 Sep 2023 08:22:08 -0400 Subject: [PATCH 2/2] Lint fix. No-Issue Signed-off-by: James Tanner --- 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 5c911b4f5..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, provider='github').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')