X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/73b6a1639ba8f9f5fc7615c136364fdba73e5bb2..75957f735219259d3b4bc361f80ccd3d7b92a0e9:/src/ajaxable/utils.py?ds=sidebyside diff --git a/src/ajaxable/utils.py b/src/ajaxable/utils.py index 82de84771..8e34a9a57 100755 --- a/src/ajaxable/utils.py +++ b/src/ajaxable/utils.py @@ -5,9 +5,8 @@ from functools import wraps from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden -from django.shortcuts import render_to_response -from django.template import RequestContext -from django.utils.encoding import force_unicode +from django.shortcuts import render +from django.utils.encoding import force_text from django.utils.functional import Promise from django.utils.http import urlquote_plus import json @@ -19,7 +18,7 @@ from honeypot.decorators import verify_honeypot_value class LazyEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, Promise): - return force_unicode(obj) + return force_text(obj) return obj @@ -153,7 +152,7 @@ class AjaxableFormView(object): "view_kwargs": kwargs, } context.update(self.extra_context(request, obj)) - return render_to_response(template, context, context_instance=RequestContext(request)) + return render(request, template, context) def validate_object(self, obj, request): return None