Ticket #22057: patch_commit_d27adb83dd26.patch

File patch_commit_d27adb83dd26.patch, 1.1 KB (added by Akis Kesoglou, 10 years ago)
  • django/http/response.py

    diff --git a/django/http/response.py b/django/http/response.py
    index 324f67c847b5d18ccad613a48560ad0e8fea0768..afa8ac91de9136a63c378a26760b6410ff2557fa 100644
    a b from django.conf import settings  
    1414from django.core import signals
    1515from django.core import signing
    1616from django.core.exceptions import DisallowedRedirect
    17 from django.core.serializers.json import DjangoJSONEncoder
    1817from django.http.cookie import SimpleCookie
    1918from django.utils import six, timezone
    2019from django.utils.encoding import force_bytes, force_text, iri_to_uri
    class JsonResponse(HttpResponse):  
    473472      to ``True``.
    474473    """
    475474
    476     def __init__(self, data, encoder=DjangoJSONEncoder, safe=True, **kwargs):
     475    def __init__(self, data, encoder=None, safe=True, **kwargs):
     476        if encoder is None:
     477            from django.core.serializers.json import DjangoJSONEncoder
     478            encoder = DjangoJSONEncoder
    477479        if safe and not isinstance(data, dict):
    478480            raise TypeError('In order to allow non-dict objects to be '
    479481                'serialized set the safe parameter to False')
Back to Top