diff rhodecode/controllers/api/__init__.py @ 1796:6274adc06988 beta

fixed RPC call for api that was missing request id
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 21 Dec 2011 02:07:41 +0200
parents 631caf880b87
children cf51bbfb120e
line wrap: on
line diff
--- a/rhodecode/controllers/api/__init__.py	Wed Dec 21 02:06:09 2011 +0200
+++ b/rhodecode/controllers/api/__init__.py	Wed Dec 21 02:07:41 2011 +0200
@@ -4,7 +4,7 @@
     ~~~~~~~~~~~~~~~~~~~~~~~~~
 
     JSON RPC controller
-    
+
     :created_on: Aug 20, 2011
     :author: marcink
     :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>    
@@ -226,15 +226,20 @@
         if self._error is not None:
             raw_response = None
 
-        response = dict(id=self._req_id, result=raw_response,
+        response = dict(id=self._req_id, result=raw_response, 
                         error=self._error)
 
         try:
             return json.dumps(response)
         except TypeError, e:
             log.debug('Error encoding response: %s', e)
-            return json.dumps(dict(result=None,
-                                   error="Error encoding response"))
+            return json.dumps(
+                dict(
+                    self._req_id,
+                    result=None,
+                    error="Error encoding response"
+                )
+            )
 
     def _find_method(self):
         """