Commit acae1518 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Generate UUID for id of Business Commit and Business Item

parent 3eaef7e6
...@@ -39,6 +39,7 @@ import fnmatch ...@@ -39,6 +39,7 @@ import fnmatch
import re import re
import threading import threading
import pprint import pprint
import uuid
from copy import deepcopy from copy import deepcopy
from collections import defaultdict from collections import defaultdict
...@@ -115,9 +116,6 @@ class BusinessCommit(Folder): ...@@ -115,9 +116,6 @@ class BusinessCommit(Folder):
Also, copy the objects in the Business Commit after creating new object Also, copy the objects in the Business Commit after creating new object
""" """
if id is None: if id is None:
id = self.generateNewId() id = uuid.uuid1()
id = str(str(id) + '_' + str(time.time())).replace('.', '') return super(BusinessCommit, self).newContent(id, **kw)
new_object = super(BusinessCommit, self).newContent(id, **kw)
return new_object
...@@ -37,6 +37,7 @@ import sys ...@@ -37,6 +37,7 @@ import sys
import hashlib import hashlib
import pprint import pprint
import transaction import transaction
import uuid
from Acquisition import Implicit, Explicit from Acquisition import Implicit, Explicit
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
...@@ -183,9 +184,8 @@ class CommitTool (BaseTool): ...@@ -183,9 +184,8 @@ class CommitTool (BaseTool):
Override newContent so as to use 'id' generated like hash Override newContent so as to use 'id' generated like hash
""" """
if id is None: if id is None:
id = self.generateNewId() id = uuid.uuid1()
id = str(str(id) + '_' + str(time.time())).replace('.', '')
new_obj = super(CommitTool, self).newContent(id, **kw) new_obj = super(CommitTool, self).newContent(id, **kw)
# Add the last commit as its predecessor # Add the last commit as its predecessor
......
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