web/views/basecontrollers.py
branchtls-sprint
changeset 1635 866563e2d0fc
parent 1560 7dd2a81b8bc8
child 1713 d817f23439ba
--- a/web/views/basecontrollers.py	Mon May 04 10:52:00 2009 +0200
+++ b/web/views/basecontrollers.py	Mon May 04 11:47:33 2009 +0200
@@ -20,7 +20,7 @@
 from cubicweb.selectors import yes, match_user_groups
 from cubicweb.view import STRICT_DOCTYPE
 from cubicweb.common.mail import format_mail
-from cubicweb.web import ExplicitLogin, Redirect, RemoteCallFailed
+from cubicweb.web import ExplicitLogin, Redirect, RemoteCallFailed, json_dumps
 from cubicweb.web.formrenderers import FormRenderer
 from cubicweb.web.controller import Controller
 from cubicweb.web.views import vid_from_rset
@@ -42,8 +42,7 @@
     """
     def wrapper(self, *args, **kwargs):
         self.req.set_content_type('application/json')
-        result = func(self, *args, **kwargs)
-        return simplejson.dumps(result)
+        return json_dumps(func(self, *args, **kwargs))
     wrapper.__name__ = func.__name__
     return wrapper