Mercurial > kallithea
changeset 1662:f62a960bae39 beta
Automated merge with https://bitbucket.org/marcinkuzminski/rhodecode
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 08 Nov 2011 17:13:59 +0200 |
parents | 40db9e086773 (current diff) fe5575f95850 (diff) |
children | 3bd7d89d918a |
files | |
diffstat | 3 files changed, 22 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/development.ini Mon Nov 07 16:06:24 2011 -0500 +++ b/development.ini Tue Nov 08 17:13:59 2011 +0200 @@ -131,6 +131,12 @@ ## 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
--- a/production.ini Mon Nov 07 16:06:24 2011 -0500 +++ b/production.ini Tue Nov 08 17:13:59 2011 +0200 @@ -130,6 +130,12 @@ ## 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
--- a/rhodecode/controllers/api/__init__.py Mon Nov 07 16:06:24 2011 -0500 +++ b/rhodecode/controllers/api/__init__.py Tue Nov 08 17:13:59 2011 +0200 @@ -36,7 +36,7 @@ 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 @@ 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):