Skip to content

Commit

Permalink
hot fix for anon users hitting the rest api
Browse files Browse the repository at this point in the history
  • Loading branch information
hdoupe committed Oct 3, 2019
1 parent 207e4d1 commit 1c56503
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webapp/apps/comp/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

class RequiresActive(BasePermission):
def has_permission(self, request, view):
return bool(request.user.profile and request.user.profile.is_active)
return bool(
request.user.is_authenticated
and request.user.profile
and request.user.profile.is_active
)


class RequiresPayment(BasePermission):
Expand Down

0 comments on commit 1c56503

Please sign in to comment.