Missing check on self.local.
This commit is contained in:
parent
ffea0f7a69
commit
cd091eadca
@ -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):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user