From b59521e7f6c0a80681588b910c03931d5293342d Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Mon, 21 Jan 2019 20:20:34 +0300 Subject: [PATCH] fix bug --- djing/lib/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djing/lib/decorators.py b/djing/lib/decorators.py index d903cd8..587f099 100644 --- a/djing/lib/decorators.py +++ b/djing/lib/decorators.py @@ -99,7 +99,7 @@ def json_view(fn): @wraps(fn) def wrapped(request, *args, **kwargs): r = fn(request, *args, **kwargs) - if not isinstance(r['text'], str): + if 'text' in r.keys() and not isinstance(r['text'], str): r['text'] = str(r['text']) return JsonResponse(dict(r), safe=False, json_dumps_params={ 'ensure_ascii': False