Show More
@@ -131,6 +131,12 b' beaker.cache.sql_cache_long.key_length =' | |||||
131 | ## dbm, file, memcached, database, and memory. |
|
131 | ## dbm, file, memcached, database, and memory. | |
132 | ## The storage uses the Container API |
|
132 | ## The storage uses the Container API | |
133 | ##that is also used by the cache system. |
|
133 | ##that is also used by the cache system. | |
|
134 | ||||
|
135 | #db session example | |||
|
136 | #beaker.session.type = ext:database | |||
|
137 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode | |||
|
138 | #beaker.session.table_name = db_session | |||
|
139 | ||||
134 | beaker.session.type = file |
|
140 | beaker.session.type = file | |
135 |
|
141 | |||
136 | beaker.session.key = rhodecode |
|
142 | beaker.session.key = rhodecode |
@@ -130,6 +130,12 b' beaker.cache.sql_cache_long.key_length =' | |||||
130 | ## dbm, file, memcached, database, and memory. |
|
130 | ## dbm, file, memcached, database, and memory. | |
131 | ## The storage uses the Container API |
|
131 | ## The storage uses the Container API | |
132 | ##that is also used by the cache system. |
|
132 | ##that is also used by the cache system. | |
|
133 | ||||
|
134 | #db session example | |||
|
135 | #beaker.session.type = ext:database | |||
|
136 | #beaker.session.sa.url = postgresql://postgres:qwe@localhost/rhodecode | |||
|
137 | #beaker.session.table_name = db_session | |||
|
138 | ||||
133 | beaker.session.type = file |
|
139 | beaker.session.type = file | |
134 |
|
140 | |||
135 | beaker.session.key = rhodecode |
|
141 | beaker.session.key = rhodecode |
@@ -36,7 +36,7 b' from rhodecode.lib.compat import izip_lo' | |||||
36 | from paste.response import replace_header |
|
36 | from paste.response import replace_header | |
37 |
|
37 | |||
38 | from pylons.controllers import WSGIController |
|
38 | from pylons.controllers import WSGIController | |
39 | from pylons.controllers.util import Response |
|
39 | ||
40 |
|
40 | |||
41 | from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError, \ |
|
41 | from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError, \ | |
42 | HTTPBadRequest, HTTPError |
|
42 | HTTPBadRequest, HTTPError | |
@@ -56,9 +56,15 b' class JSONRPCError(BaseException):' | |||||
56 |
|
56 | |||
57 |
|
57 | |||
58 | def jsonrpc_error(message, code=None): |
|
58 | def jsonrpc_error(message, code=None): | |
59 | """Generate a Response object with a JSON-RPC error body""" |
|
59 | """ | |
60 | return Response(body=json.dumps(dict(result=None, |
|
60 | Generate a Response object with a JSON-RPC error body | |
61 | error=message))) |
|
61 | """ | |
|
62 | from pylons.controllers.util import Response | |||
|
63 | resp = Response(body=json.dumps(dict(result=None, error=message)), | |||
|
64 | status=code, | |||
|
65 | content_type='application/json') | |||
|
66 | return resp | |||
|
67 | ||||
62 |
|
68 | |||
63 |
|
69 | |||
64 | class JSONRPCController(WSGIController): |
|
70 | class JSONRPCController(WSGIController): |
General Comments 0
You need to be logged in to leave comments.
Login now