Undo of delete person on dbapi fails; fixes #10070

This commit is contained in:
prculley 2017-06-04 09:08:06 -05:00
parent 8f69201a70
commit a1205009f4

View File

@ -670,11 +670,11 @@ class DBAPI(DbGeneric):
if self.readonly or not handle: if self.readonly or not handle:
return return
if self.has_handle(obj_key, handle): if self.has_handle(obj_key, handle):
data = self.get_raw_data(obj_key, handle)
table = KEY_TO_NAME_MAP[obj_key] table = KEY_TO_NAME_MAP[obj_key]
sql = "DELETE FROM %s WHERE handle = ?" % table sql = "DELETE FROM %s WHERE handle = ?" % table
self.dbapi.execute(sql, [handle]) self.dbapi.execute(sql, [handle])
if not transaction.batch: if not transaction.batch:
data = self.get_raw_data(obj_key, handle)
transaction.add(obj_key, TXNDEL, handle, data, None) transaction.add(obj_key, TXNDEL, handle, data, None)
def find_backlink_handles(self, handle, include_classes=None): def find_backlink_handles(self, handle, include_classes=None):