Commit 29c0d886 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Only use commit as predecessor value

parent 721c8023
......@@ -189,7 +189,9 @@ class CommitTool (BaseTool):
new_obj = super(CommitTool, self).newContent(id, **kw)
# Add the last commit as its predecessor
commit_list = [l for l in self.objectValues() if l != new_obj]
commit_list = [l for l
in self.objectValues(portal_type='Business Commit')
if l != new_obj]
latest_commit = max(commit_list, key=(lambda x: x.getCreationDate()))
# TODO: Add check for no latest_commit
new_obj.setPredecessorValue(latest_commit)
......
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