From ade54ffa34ddc6c19b26c6ea72b46f73af7b682b Mon Sep 17 00:00:00 2001 From: Alexander Gaevsky Date: Thu, 7 Jan 2016 11:07:15 +0200 Subject: Refs #25165 -- Fixed JSON serialization for add/edit popup in the admin. Forwardport of test in o839d71d8562abe0b245024e55ca1d02a45e58fd from stable/1.9.x (refs #25997). --- django/contrib/admin/options.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 8b0af2b78d..a09c958282 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -1135,9 +1135,9 @@ class ModelAdmin(BaseModelAdmin): new_value = obj.serializable_value(attr) popup_response_data = json.dumps({ 'action': 'change', - 'value': value, + 'value': six.text_type(value), 'obj': six.text_type(obj), - 'new_value': new_value, + 'new_value': six.text_type(new_value), }) return SimpleTemplateResponse('admin/popup_response.html', { 'popup_response_data': popup_response_data, -- cgit v1.3