From ac1f27bb2566ff7036730ad30f05d09b671804e2 Mon Sep 17 00:00:00 2001 From: Christopher Slowe Date: Tue, 7 Jul 2009 10:18:29 -0700 Subject: [PATCH] fix to over-agressive space compression --- r2/r2/lib/jsontemplates.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/jsontemplates.py b/r2/r2/lib/jsontemplates.py index 1ee282dea..b17e6b752 100644 --- a/r2/r2/lib/jsontemplates.py +++ b/r2/r2/lib/jsontemplates.py @@ -56,7 +56,10 @@ class ObjectTemplate(StringTemplate): elif isinstance(obj, (list, tuple)): return map(_update, obj) elif isinstance(obj, CacheStub) and kw.has_key(obj.name): - return spaceCompress(kw[obj.name]) + r = kw[obj.name] + if isinstance(r, (str, unicode)): + r = spaceCompress(r) + return r else: return obj res = _update(self.d)