summaryrefslogtreecommitdiff
path: root/index.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2012-01-10 22:01:37 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2012-01-10 22:01:37 +0100
commita5c0cd1a0f496325035fbd3f3cbb8b81e7648301 (patch)
tree50cf8500662a618b2c2d2ff7122cec5b69e50186 /index.py
parent77817e08eb237c207cc93d9545c61fb30e0059a9 (diff)
downloadkosten-a5c0cd1a0f496325035fbd3f3cbb8b81e7648301.tar.gz
kosten-a5c0cd1a0f496325035fbd3f3cbb8b81e7648301.tar.bz2
kosten-a5c0cd1a0f496325035fbd3f3cbb8b81e7648301.zip
Fix bug that prevents closing sql-connections
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