Error in using transactions

This commit is contained in:
Doug Blank 2013-12-24 20:40:56 -05:00
parent 2fb9f2ffa0
commit 7daf720ee7

View File

@ -546,7 +546,7 @@ class Struct(object):
def update_db(self, trans=None):
if self.db:
if trans is None:
with self.transaction("Struct Update", self.db):
with self.transaction("Struct Update", self.db) as trans:
new_obj = from_struct(self.struct)
name, handle = self.struct["_class"], self.struct["handle"]
old_obj = self.db.get_from_name_and_handle(name, handle)