Skip to content

Commit

Permalink
really really really fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed May 18, 2017
1 parent ddb9173 commit 88ace21
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion guillotina/transactions.py
Expand Up @@ -84,5 +84,10 @@ async def __aexit__(self, exc_type, exc, tb):
else:
await self.tm.commit(txn=self.txn)
if self.request is not None:
self.request._txn = self.previous_txn
if self.previous_txn is not None:
# we do not want to overwrite _txn if is it None since we can
# reuse transaction objects and we don't want to screw up
# stale objects that reference dangling transactions with no
# db connection
self.request._txn = self.previous_txn
self.request._db_write_enabled = self.previous_write_setting

0 comments on commit 88ace21

Please sign in to comment.