wrap batch execution with transaction.manager
This commit is contained in:
parent
81f6b57a63
commit
b28631d421
|
@ -29,6 +29,7 @@
|
|||
import formalchemy
|
||||
from sqlalchemy import and_, or_
|
||||
|
||||
import transaction
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
from pyramid.renderers import render
|
||||
from pyramid.response import Response
|
||||
|
@ -801,6 +802,8 @@ def execute(context, request):
|
|||
# print 'got a batch'
|
||||
|
||||
uuid = request.matchdict['uuid']
|
||||
|
||||
with transaction.manager:
|
||||
batch = Session.query(rattail.Batch).get(uuid) if uuid else None
|
||||
if not batch:
|
||||
return home
|
||||
|
|
Loading…
Reference in a new issue