Fakultas Ilmu Komputer UI

Commit 7f4030d1 authored by Bimo Iman Smartadi's avatar Bimo Iman Smartadi
Browse files

[REFACTOR] Added default image value

parent 61e3baad
Pipeline #42282 passed with stages
in 5 minutes and 9 seconds
......@@ -104,11 +104,15 @@ def add_fasilitas(request, nama_lokasi):
deskripsi = request.POST['deskripsi']
rating = request.POST['rating']
tag = request.POST['tag'].split()
image = ""
if 'image' in request.POST.keys():
image = str(request.POST['image'])
fasilitas = Fasilitas.objects.create(lokasi=lokasi,
user=user,
deskripsi=deskripsi,
rating=rating,
tag=tag)
tag=tag,
image = image)
return JsonResponse({'response' : 'fasilitas added', 'id':fasilitas.id}, status = 201)
else:
return JsonResponse({'response' : request_error_message("post")}, status = 400)
......
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