diff --git a/backend/users/authentication.py b/backend/users/authentication.py index 3114f2263..7fc25c7b5 100644 --- a/backend/users/authentication.py +++ b/backend/users/authentication.py @@ -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()