blinding patching emitters.py, fixes #104
This commit is contained in:
Родитель
7719bd0f27
Коммит
51cd3b0e0c
|
@ -381,11 +381,11 @@ class JSONEmitter(Emitter):
|
||||||
JSON emitter, understands timestamps.
|
JSON emitter, understands timestamps.
|
||||||
"""
|
"""
|
||||||
def render(self, request):
|
def render(self, request):
|
||||||
cb = request.GET.get('callback')
|
cb = request.GET.get('callback', None)
|
||||||
seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
|
seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
|
||||||
|
|
||||||
# Callback
|
# Callback
|
||||||
if is_valid_jsonp_callback_value(cb):
|
if cb and is_valid_jsonp_callback_value(cb):
|
||||||
return '%s(%s)' % (cb, seria)
|
return '%s(%s)' % (cb, seria)
|
||||||
|
|
||||||
return seria
|
return seria
|
||||||
|
|
Загрузка…
Ссылка в новой задаче