Commit 90dd2fe1 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Raise same error as in FileStorage when trying to undo a transaction where there

is no previous record for an object.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@408 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 101fb645
......@@ -690,10 +690,11 @@ class Application(object):
# Second get object data from storage node using loadBefore
data_dict = {}
for oid in oid_list:
try:
result = self.loadBefore(oid, transaction_id)
# no previous revision, can't undo
if result is None:
raise UndoError("non-undoable transaction", oid)
except NEOStorageNotFoundError:
# no previous revision, can't undo (as in filestorage)
raise UndoError("no previous record", oid)
data, start, end = result
# end must be TID we are going to undone otherwise it means
# a later transaction modify the object
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment