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
DTB-Layanan Fasilitas Publik Penyandang Disabilitas
PoiPoLeGan-PPLapanganTembak-DTB Layanan Fasilitas Publik Penyandang Disabilitas-BE
Commits
8d847ae9
Commit
8d847ae9
authored
Apr 10, 2020
by
Usman Sidiq
Browse files
[REFACTOR] Delete debug code and add new app to settings.py
parent
0896d4e5
Pipeline
#39845
passed with stages
in 3 minutes and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
informasi_fasilitas/tests.py
View file @
8d847ae9
...
...
@@ -36,7 +36,7 @@ class Informasi_Fasilitas_Test(TestCase):
def
test_models_create_new_fasilitas
(
self
):
image
=
tempfile
.
NamedTemporaryFile
(
suffix
=
".jpg"
).
name
user
=
User
(
username
=
'user'
,
username
=
'user
@gmail.com
'
,
last_name
=
'name'
,
email
=
'user@gmail.com'
,
password
=
'hahagotim'
...
...
informasi_fasilitas/views.py
View file @
8d847ae9
...
...
@@ -62,8 +62,6 @@ def add_lokasi(request):
return
JsonResponse
({
'response'
:
'try post request instead'
},
status
=
400
)
except
KeyError
as
e
:
return
JsonResponse
({
'response'
:
'bad request. {} key needed'
.
format
(
str
(
e
))},
status
=
500
)
except
:
return
JsonResponse
({
'response'
:
'wrong routing'
},
status
=
404
)
# @api_view(['GET'])
# @authentication_classes([TokenAuthentication,])
...
...
@@ -97,13 +95,10 @@ def add_fasilitas(request, nama_lokasi):
deskripsi
=
request
.
POST
[
'deskripsi'
]
image
=
request
.
POST
[
'image'
]
print
(
lokasi
)
print
(
user
)
fasilitas
=
Fasilitas
.
objects
.
create
(
lokasi
=
lokasi
,
user
=
user
,
deskripsi
=
deskripsi
,
image
=
image
)
fasilitas
.
save
()
return
JsonResponse
({
'response'
:
'fasilitas added'
},
status
=
201
)
else
:
return
JsonResponse
({
'response'
:
'try post request instead'
},
status
=
400
)
...
...
pplbackend/settings.py
View file @
8d847ae9
...
...
@@ -46,6 +46,8 @@ INSTALLED_APPS = [
'registrasi'
,
'rest_api'
,
'informasi_fasilitas'
,
'new_rest_api'
,
'rest_auth'
,
'rest_framework'
,
'rest_framework.authtoken'
,
...
...
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