summaryrefslogtreecommitdiff
path: root/index.py
diff options
context:
space:
mode:
Diffstat (limited to 'index.py')
-rwxr-xr-xindex.py13
1 files changed, 7 insertions, 6 deletions
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