diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -131,6 +131,12 @@ beaker.cache.sql_cache_long.key_length = ## dbm, file, memcached, database, and memory. ## The storage uses the Container API ##that is also used by the cache system. + +#db session example +#beaker.session.type = ext:database +#beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode +#beaker.session.table_name = db_session + beaker.session.type = file beaker.session.key = rhodecode diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -130,6 +130,12 @@ beaker.cache.sql_cache_long.key_length = ## dbm, file, memcached, database, and memory. ## The storage uses the Container API ##that is also used by the cache system. + +#db session example +#beaker.session.type = ext:database +#beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode +#beaker.session.table_name = db_session + beaker.session.type = file beaker.session.key = rhodecode diff --git a/rhodecode/controllers/api/__init__.py b/rhodecode/controllers/api/__init__.py --- a/rhodecode/controllers/api/__init__.py +++ b/rhodecode/controllers/api/__init__.py @@ -36,7 +36,7 @@ from rhodecode.lib.compat import izip_lo from paste.response import replace_header from pylons.controllers import WSGIController -from pylons.controllers.util import Response + from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError, \ HTTPBadRequest, HTTPError @@ -56,9 +56,15 @@ class JSONRPCError(BaseException): def jsonrpc_error(message, code=None): - """Generate a Response object with a JSON-RPC error body""" - return Response(body=json.dumps(dict(result=None, - error=message))) + """ + Generate a Response object with a JSON-RPC error body + """ + from pylons.controllers.util import Response + resp = Response(body=json.dumps(dict(result=None, error=message)), + status=code, + content_type='application/json') + return resp + class JSONRPCController(WSGIController):