From 993e7bc5aeb9728526ee178c3041f7bd3a96599d Mon Sep 17 00:00:00 2001 From: Bimo Iman Smartadi Date: Sat, 18 Apr 2020 18:05:43 +0700 Subject: [PATCH 1/3] [CHORES] Fixed ProgrammingError that happens only in heroku --- .gitlab-ci.yml | 1 + deployment.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5fd7b78..3fd900c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ UnitTest: coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+)%/' before_script: - pip install -r requirements.txt + - python manage.py makemigrations - python manage.py migrate - python manage.py collectstatic --no-input when: on_success diff --git a/deployment.sh b/deployment.sh index b5cba14..c03974f 100644 --- a/deployment.sh +++ b/deployment.sh @@ -1,2 +1,3 @@ #!/bin/bash +python manage.py makemigrations python manage.py migrate -- GitLab From ebdc38936935a8c8155b50787c30aba035238744 Mon Sep 17 00:00:00 2001 From: Muhammad Abdurrahman Date: Sat, 2 May 2020 17:31:03 +0700 Subject: [PATCH 2/3] [CHORES] edit readme and register sekoolah to admin --- README.md | 8 ++++---- layanan_khusus/admin.py | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0b159ce..9d63a2a 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ It requires a request with the following key: This token is also used to authorize whether you are the creator of the facility or not, since only the creator of the facility could update the facility -### 10. To update a location phone_number: +### 11. To update a location phone_number: Make `PUT` request to API endpoint `/informasi-lokasi/lokasi/update-lokasi/*nama-lokasi*/`.
It requires a request with the following key: * `no_telp`: the description @@ -172,7 +172,7 @@ It requires a request with the following key: This token is also used to authorize whether you are the creator of the location or not, since only the creator of the location could update the location -### 10. To like / dislike a facility: +### 12. To like / dislike a facility: Make `PUT` request to API endpoint `/informasi-lokasi/lokasi/like-facility/*nama-lokasi*/*operation*/`.
Replace the `operation` with: * `like` : if you want to like the facility @@ -182,7 +182,7 @@ the "like" you give before will be replaced by dislike, and vice-versa. Make sure you have token it your request header. Add this to your request header. `Authorization` with value `token *your_token_from_request*` -### 11. To view a sekolah list: +### 13. To view a sekolah list: Make `GET` request to API endpoint `/layanan-khusus/sekolah/list/`.
It will return a json list of sekolah with key: * `id` : id of sekolah @@ -195,7 +195,7 @@ It will return a json list of sekolah with key: * `jenis_sekolah` : type of sekolah's management (inklusi, segregasi) * `akreditasi` : accreditation -### 12. To view a sekolah details: +### 14. To view a sekolah details: Make `GET` request to API endpoint `/layanan-khusus/sekolah/detail/*id_sekolah*/`.
It will return a json with key: * `id` : id of sekolah diff --git a/layanan_khusus/admin.py b/layanan_khusus/admin.py index 8c38f3f..2e3a9d4 100644 --- a/layanan_khusus/admin.py +++ b/layanan_khusus/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models import Sekolah # Register your models here. +admin.site.register(Sekolah) -- GitLab From 1fe837a81445d4ab23e2a5d0cca3154bbbe868b3 Mon Sep 17 00:00:00 2001 From: Muhammad Abdurrahman Date: Sat, 2 May 2020 18:03:56 +0700 Subject: [PATCH 3/3] [CHORES] update pylint version in requirement and fix school type --- layanan_khusus/models.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layanan_khusus/models.py b/layanan_khusus/models.py index 4a61239..d44572d 100644 --- a/layanan_khusus/models.py +++ b/layanan_khusus/models.py @@ -28,7 +28,7 @@ class Sekolah(models.Model): ) jenis_sekolah = models.CharField( max_length=2, - choices=STATUS_SEKOLAH, + choices=JENIS, default=INKLUSI ) akreditasi = models.CharField(max_length=1, null=True, default=None) diff --git a/requirements.txt b/requirements.txt index 800c0e1..4c6fb15 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,7 +33,7 @@ pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.19 PyJWT==1.7.1 -pylint==1.7.2 +pylint==2.5.0 pylint-django==2.0.15 python3-openid==3.1.0 pytz==2017.2 -- GitLab