Fakultas Ilmu Komputer UI

Commit ee6ba1f9 authored by Zamil Majdy's avatar Zamil Majdy
Browse files

[#140652771] [#21] [Refactor] add multiple "yes" value on query param

parent ed301cd8
......@@ -22,8 +22,10 @@ class VacancyViewSet(viewsets.ModelViewSet):
def list(self, request, *args, **kwargs):
vacancies = Vacancy.objects.all()
if not ('verified' in request.query_params) or request.query_params['verified']:
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)
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