Fakultas Ilmu Komputer UI

Commit 1478abaf authored by Shafiya Adzhani's avatar Shafiya Adzhani
Browse files

[REFACTOR] change status_filtered to status name variable

parent 3e9e1b05
Pipeline #74482 passed with stages
in 2 minutes and 13 seconds
......@@ -9,11 +9,11 @@ from drf_multiple_model.pagination import MultipleModelLimitOffsetPagination
def filter_status(queryset, request, *args, **kwargs):
status_filtered = request.query_params.get("status")
status = request.query_params.get("status")
if status_filtered == "Done":
if status == "Done":
return queryset.filter(status="Done")
elif status_filtered == "Ongoing":
elif status == "Ongoing":
return queryset.exclude(status="Done")
return queryset
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