Skip to content
Snippets Groups Projects
Verified Commit f3bbd025 authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Handle pure django users in userinfo endpoint

Any user that does not have a GregUserProfile must be a superuser so
this is not a problem per se, but it should be handled. For now we
simply treat them as an anonymous user and deny access.

Resolves: GREG-116
parent dbe6db61
No related branches found
No related tags found
1 merge request!172Greg 116 non oidc sessions
......@@ -39,7 +39,10 @@ class UserInfoView(APIView):
# Authenticated user, allow access
if user.is_authenticated:
user_profile = GregUserProfile.objects.get(user=user)
try:
user_profile = GregUserProfile.objects.get(user=user)
except GregUserProfile.DoesNotExist:
return Response(status=HTTP_403_FORBIDDEN)
sponsor_id = None
person_id = None
if user_profile.sponsor:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment