Commit 80799565 authored by Yusei Tahara's avatar Yusei Tahara

Remove setUniqueReference method which is not used and not working.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19327 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0ff27260
......@@ -740,23 +740,6 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
# If self is not indexed yet, then if count == 1, version is not unique
return count <= self_count
security.declareProtected(Permissions.ModifyPortalContent, 'setUniqueReference')
def setUniqueReference(self, suffix='auto'):
"""
Create a unique reference for the current document
based on a suffix
"""
# Change the document reference
catalog = getToolByName(self.getPortalObject(), 'portal_catalog')
reference = self.getReference() + '-%s-' % suffix + '%s'
ref_count = 0
kw = dict(portal_type=self.getPortalDocumentTypeList())
if self.getVersion(): kw['version'] = self.getVersion()
if self.getLanguage(): kw['language'] = self.getLanguage()
while catalog.unrestrictedCountResults(reference=reference % ref_count, **kw)[0][0]:
ref_count += 1
self._setReference(reference % ref_count)
security.declareProtected(Permissions.AccessContentsInformation, 'getRevision')
def getRevision(self):
"""
......
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