Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
DIGIPUS
Commits
6db72fd1
Commit
6db72fd1
authored
Oct 01, 2020
by
insan ramadhan
Browse files
check login session before submit request
parent
8f6204e8
Pipeline
#57065
passed with stages
in 9 minutes and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/templates/req_materi.html
View file @
6db72fd1
...
@@ -55,7 +55,11 @@
...
@@ -55,7 +55,11 @@
<div
class=
"row header"
>
<div
class=
"row header"
>
<div
class=
"col"
>
<div
class=
"col"
>
<h2
class=
"pageTitle"
>
Permintaan materi!
</h2>
<h2
class=
"pageTitle"
>
Permintaan materi!
</h2>
{% if user %}
<p
class=
"description"
>
Tuliskan judul materi yang kamu mau
</p>
<p
class=
"description"
>
Tuliskan judul materi yang kamu mau
</p>
{% else %}
<p
class=
"description"
>
Tuliskan judul materi yang kamu mau, anda harus login terlebih dahulu untuk melakukan permintaan
</p>
{% endif %}
<form
class=
"searchBar"
>
<form
class=
"searchBar"
>
{% csrf_token %}
{% csrf_token %}
<div
class=
"col-6 form-group"
>
<div
class=
"col-6 form-group"
>
...
...
app/views.py
View file @
6db72fd1
...
@@ -393,8 +393,11 @@ class ReqMateriView(TemplateView):
...
@@ -393,8 +393,11 @@ class ReqMateriView(TemplateView):
template_name
=
"req_materi.html"
template_name
=
"req_materi.html"
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
if
not
request
.
user
.
is_admin
:
if
request
.
user
.
is_authenticated
==
False
:
raise
PermissionDenied
(
request
)
return
HttpResponseRedirect
(
"/login/"
)
#raise PermissionDenied(request)
# else if not request.user.is_admin:
# raise PermissionDenied(request)
return
super
(
ReqMateriView
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
return
super
(
ReqMateriView
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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