From 174d93eea8dedbff6e9b515168bf7bdebbcc292b Mon Sep 17 00:00:00 2001 From: Ruzal Date: Sat, 18 Nov 2023 21:23:10 +0300 Subject: [PATCH] Fixed ProjectFilter --- backend/api/filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/api/filters.py b/backend/api/filters.py index 7aeddf4..64e62db 100644 --- a/backend/api/filters.py +++ b/backend/api/filters.py @@ -1,8 +1,8 @@ import django_filters from django.db.models import Q -from django.http import Http404 from django.utils import timezone from django_filters.rest_framework import FilterSet, filters +from rest_framework.exceptions import ParseError from taggit.models import Tag from content.models import City, Skills @@ -88,7 +88,7 @@ def filter_queryset(self, queryset): try: queryset = super().filter_queryset(queryset) except (ValueError, self.Meta.model.DoesNotExist): - raise Http404("Invalid filter value for {}".format(name)) + raise ParseError("Invalid filter value for {}".format(name)) return queryset