Skip to content

Commit

Permalink
Only select social accounts from github to get the github id. (#3248)
Browse files Browse the repository at this point in the history
* Only select social accounts from github to get the github id.

No-Issue

Signed-off-by: James Tanner <[email protected]>

* Lint fix.

No-Issue

Signed-off-by: James Tanner <[email protected]>

---------

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Sep 19, 2023
1 parent 6a374ca commit b63a816
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion galaxy/api/serializers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit b63a816

Please sign in to comment.