From d51a646ad278c0ffb1154dddf22aeb5b2f3f09b7 Mon Sep 17 00:00:00 2001 From: Jakub Kaniecki Date: Mon, 17 Jun 2024 17:14:28 +0200 Subject: [PATCH] poprawki --- jobposting/views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jobposting/views.py b/jobposting/views.py index cd1ebb4..2dd6960 100644 --- a/jobposting/views.py +++ b/jobposting/views.py @@ -82,6 +82,8 @@ class JobOfferListView(APIView): categories = request.query_params.get('categories[]', None) max_salary = request.query_params.get('max_salary', None) min_salary = request.query_params.get('min_salary', None) + localization = request.query_params.get('localization', None) + name = request.query_params.get('name', None) if max_salary is not None or max_salary != '': try: @@ -90,6 +92,8 @@ class JobOfferListView(APIView): max_salary = None except TypeError: max_salary = None + else: + max_salary = None if min_salary is not None or min_salary != '': try: min_salary = int(min_salary) @@ -97,6 +101,12 @@ class JobOfferListView(APIView): min_salary = None except TypeError: min_salary = None + else: + min_salary = None + if localization is not None or localization != '': + pass + else: + localization = None filters = { 'name__icontains': name, 'min_salary__gte': min_salary,