Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Backend
Commits
4066c0ec
Commit
4066c0ec
authored
Jun 04, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/commons/permissions.py
View file @
4066c0ec
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment