diff options
Diffstat (limited to 'index.py')
-rwxr-xr-x | index.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -24,18 +24,19 @@ urls = ( # ORM # def handle_sql(handler): - web.ctx.orm = session = model.session + web.ctx.orm = model.session try: - return handler() + h = handler() except web.HTTPError: - session.commit() - raise + web.ctx.orm.commit() + raise except: - session.rollback() + web.ctx.orm.rollback() raise else: - session.commit() + web.ctx.orm.commit() + return h # # The App |