Fakultas Ilmu Komputer UI

Commit 5d407635 authored by Joshua Casey's avatar Joshua Casey
Browse files

[#44] [#Refactor] added filter for verified=false for vacancy list

parent 4e7e0d36
......@@ -33,6 +33,8 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet):
verified = request.query_params['verified'] if 'verified' in request.query_params else "True"
if verified.lower() in ("yes", "true", "t", "1"):
vacancies = vacancies.filter(verified=True)
if verified.lower() in {"no", "false", "f", "0"}:
vacancies = vacancies.filter(verified=False)
return Response(VacancySerializer(vacancies, many=True, context={'request': request}).data)
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