Projet

Général

Profil

0001-py3-convert-encode-query-to-text-44464.patch

Serghei Mihai, 26 juin 2020 00:38

Télécharger (1,15 ko)

Voir les différences:

Subject: [PATCH] py3: convert encode query to text (#44464)

 passerelle_montpellier_sig/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
passerelle_montpellier_sig/views.py
149 149
            voies.append({'id': voie, 'text': prefix_cleanup(voie)})
150 150

  
151 151
        if 'q' in request.GET and request.GET['q']:
152
            q = force_text(request.GET['q']).upper()
152
            q = request.GET['q'].upper()
153 153
            q = q.replace("'", ' ')
154 154
            q = unicodedata.normalize('NFKD', q).encode('ascii', 'ignore')
155
            voies = [v for v in voies if q in v['text']]
155
            voies = [v for v in voies if force_text(q) in v['text']]
156 156

  
157 157
        voies.sort(lambda x, y: cmp(x['id'], y['id']))
158 158
        return utils.response_for_json(request, {'data': voies})
159
-