diff --git a/server/szurubooru/rest/app.py b/server/szurubooru/rest/app.py index b4d23d42..391d297f 100644 --- a/server/szurubooru/rest/app.py +++ b/server/szurubooru/rest/app.py @@ -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)