Commit 760175eb authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

filter_valid_name: __icontains

parent 35b530ae
Pipeline #3331 passed with stages
in 9 minutes and 18 seconds
......@@ -4,11 +4,11 @@ from . import models, utils
def filter_valid_name(queryset, name, value):
return queryset.filter(**{name: utils.valid_name(value)})
return queryset.filter(**{f'{name}__icontains': utils.valid_name(value)})
class ProjectFilter(django_filters.rest_framework.FilterSet):
name = django_filters.CharFilter(lookup_expr='icontains', method=filter_valid_name)
name = django_filters.CharFilter(method=filter_valid_name)
class Meta:
model = models.Project
......
Markdown is supported
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