Skip to content

Commit

Permalink
fix: prevent 500 error when access token user does not have Member
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoesbergen committed Sep 3, 2023
1 parent a1282b3 commit 8236353
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion LedenAdministratie/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def get(self, request, *args, **kwargs):
if token is None:
return HttpResponseForbidden()

if not request.resource_owner or not request.resource_owner.member:
if not request.resource_owner or not hasattr(request.resource_owner, "member"):
# Access token User does not have a linked Member record -> deny access
return HttpResponseForbidden()

member = request.resource_owner.member
Expand Down

0 comments on commit 8236353

Please sign in to comment.