Fakultas Ilmu Komputer UI

Commit 4066c0ec authored by Jonathan Christopher Jakub's avatar Jonathan Christopher Jakub
Browse files

[GREEN] Add handler for anonymous user on is authenticated permission

parent 67aed26e
Pipeline #49747 passed with stages
in 3 minutes and 52 seconds
......@@ -6,6 +6,10 @@ from django.core.exceptions import ObjectDoesNotExist
class IsAuthenticated(BasePermission):
def has_permission(self, request, view):
user = request.user
if not hasattr(user, "account"):
return False
return (
user.is_authenticated
and user.account.is_active
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment