Commit cf487874 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Update category relation while creating sub-objects in commit tool

parent b687aba3
......@@ -193,8 +193,15 @@ class CommitTool (BaseTool):
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)
if new_obj.getPortalType() == 'Business Commit':
# TODO: Add check for no latest_commit. Usable especially for 1st BM
new_obj.setPredecessorValue(latest_commit)
else:
# If the new_obj is Business Snapshot, create a similar value for the
# latest commit
new_obj.setSimilarValue(latest_commit)
latest_commit.setSimilarValue(new_obj)
return new_obj
......
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