Projet

Général

Profil

0001-python3-build-ajax-response-using-text-content-40733.patch

Nicolas Roche, 13 mars 2020 23:58

Télécharger (1,33 ko)

Voir les différences:

Subject: [PATCH] python3: build ajax response using text content (#40733)

 src/authentic2/manager/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/authentic2/manager/views.py
276 276
            # otherwise compute an absolute URI from the relative URI
277 277
            if location and (not location.startswith('http://')
278 278
                             or not location.startswith('https://')
279 279
                             or not location.startswith('/')):
280 280
                location = request.build_absolute_uri(location)
281 281
            data['location'] = location
282 282
        if hasattr(response, 'render'):
283 283
            response.render()
284
            data['content'] = response.content
284
            data['content'] = force_text(response.content)
285 285
        return HttpResponse(json.dumps(data), content_type='application/json')
286 286

  
287 287

  
288 288
class TitleMixin(object):
289 289
    '''Mixin to provide a title to the view's template'''
290 290
    title = ''
291 291

  
292 292
    def get_context_data(self, **kwargs):
293
-