Fakultas Ilmu Komputer UI

Commit 58377497 authored by Jonathan Christopher Jakub's avatar Jonathan Christopher Jakub
Browse files

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

parent 0554eae0
Pipeline #49742 failed with stages
in 1 minute and 42 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