mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/rest: rollback session on query exception
Kills complaints from sqlalchemy when an error happens during insertion/update hook.
This commit is contained in:
@ -93,6 +93,9 @@ def application(env, start_response):
|
||||
hook(ctx)
|
||||
try:
|
||||
response = handler(ctx, match.groupdict())
|
||||
except:
|
||||
ctx.session.rollback()
|
||||
raise
|
||||
finally:
|
||||
for hook in middleware.post_hooks:
|
||||
hook(ctx)
|
||||
|
Reference in New Issue
Block a user