Missing check on self.local.

This commit is contained in:
Friedrich Lindenberg 2017-09-05 07:59:02 +02:00
parent ffea0f7a69
commit cd091eadca

View File

@ -82,6 +82,8 @@ class Database(object):
@property @property
def in_transaction(self): def in_transaction(self):
"""Check if this database is in a transactional context.""" """Check if this database is in a transactional context."""
if not hasattr(self.local, 'tx'):
return False
return len(self.local.tx) > 0 return len(self.local.tx) > 0
def _flush_tables(self): def _flush_tables(self):