Skip to content

Commit

Permalink
Change return value of filter_users_by_claims
Browse files Browse the repository at this point in the history
  • Loading branch information
oleobal committed Mar 23, 2023
1 parent f033a7b commit a3982fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/users/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ def filter_users_by_claims(self, claims):
openid_subject = claims.get("sub")
issuer = claims.get("_openid_issuer")
try:
return (
# return a list because mozilla_django_oidc expects some kind of range
return [
UserOidcInfo.objects.select_related("user")
.get(openid_issuer=issuer, openid_subject=openid_subject)
.user
)
]
except UserOidcInfo.DoesNotExist:
return self.UserModel.objects.none()

Expand Down

0 comments on commit a3982fe

Please sign in to comment.