From 67721cf288282a6f471ca3ee468d7ef4dab02e6a Mon Sep 17 00:00:00 2001 From: Evgeny Demchenko Date: Thu, 8 Mar 2012 15:38:13 +0800 Subject: [PATCH] Fixed TypeError problem --- dynamicsettings/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dynamicsettings/views.py b/dynamicsettings/views.py index 023eda9..4f5b4ac 100644 --- a/dynamicsettings/views.py +++ b/dynamicsettings/views.py @@ -38,7 +38,10 @@ def dynamicsettings_index(request): for key in keys: value = settings.get(key) if isinstance(value, (list, tuple, dict)): - value = simplejson.dumps(value, indent=4) + try: + value = simplejson.dumps(value, indent=4) + except TypeError: + value = 'Not a serializable object' res.append({ 'key': key, 'value': value,