Skip to content

Commit

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

* 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]>
(cherry picked from commit b63a816)
  • Loading branch information
jctanner committed Sep 19, 2023
1 parent eff3d38 commit 82c51cc
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 82c51cc

Please sign in to comment.