Commit 198e252c authored by Jean-Paul Smets's avatar Jean-Paul Smets

Cast revision to a string to be consistent with property sheet definition

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13839 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 856112c2
......@@ -743,7 +743,9 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
def getRevision(self):
"""
Returns the current revision by analysing the change log
of the current object.
of the current object. The return value is a string
in order to be consistent with the property sheet
definition.
NOTE: for now, workflow choice is hardcoded. This is
an optimisation hack. If a document does neither use
......@@ -762,8 +764,8 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
for wf in wf_list:
history = wf.getInfoFor(self, 'history', None)
if history:
return len(filter(lambda x:x.get('action', None) in ('edit', 'upload'), history))
return None
return str(len(filter(lambda x:x.get('action', None) in ('edit', 'upload'), history)))
return ''
security.declareProtected(Permissions.AccessContentsInformation, 'getRevisionList')
def getRevisionList(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