Commit 5f31138e authored by Nicolas Joyard's avatar Nicolas Joyard Committed by Jamesie Pic

Use slug to search for reps, enables searching through accents

parent 3ceda99d
......@@ -25,6 +25,7 @@ from datetime import datetime
from django.db.models import Q
from django.http import Http404
from django.shortcuts import render
from django.utils.text import slugify
from core.utils import render_paginate_list
from positions.forms import PositionForm
......@@ -119,7 +120,7 @@ def _filter_by_search(request, representative_list):
search = request.GET.get('search')
if search:
return representative_list.filter(
Q(full_name__icontains=search)
Q(slug__icontains=slugify(search))
)
else:
return representative_list
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