Fakultas Ilmu Komputer UI

Commit 8d847ae9 authored by Usman Sidiq's avatar 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
......@@ -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'
......
......@@ -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)
......
......@@ -46,6 +46,8 @@ INSTALLED_APPS = [
'registrasi',
'rest_api',
'informasi_fasilitas',
'new_rest_api',
'rest_auth',
'rest_framework',
'rest_framework.authtoken',
......
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