From a5c0cd1a0f496325035fbd3f3cbb8b81e7648301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 10 Jan 2012 22:01:37 +0100 Subject: Fix bug that prevents closing sql-connections --- index.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'index.py') diff --git a/index.py b/index.py index e7687e2..1639fc4 100755 --- a/index.py +++ b/index.py @@ -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 -- cgit v1.2.3