py3: convert encode query to text (#44464)
This commit is contained in:
parent
fb51303820
commit
300812c3b8
|
@ -149,9 +149,10 @@ class VoiesView(View, SingleObjectMixin):
|
|||
voies.append({'id': voie, 'text': prefix_cleanup(voie)})
|
||||
|
||||
if 'q' in request.GET and request.GET['q']:
|
||||
q = force_text(request.GET['q']).upper()
|
||||
q = request.GET['q'].upper()
|
||||
q = q.replace("'", ' ')
|
||||
q = unicodedata.normalize('NFKD', q).encode('ascii', 'ignore')
|
||||
q = force_text(q)
|
||||
voies = [v for v in voies if q in v['text']]
|
||||
|
||||
voies.sort(key=lambda x: x['id'])
|
||||
|
|
Loading…
Reference in New Issue