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,8 +743,10 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -743,8 +743,10 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
def getRevision(self): def getRevision(self):
""" """
Returns the current revision by analysing the change log 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 NOTE: for now, workflow choice is hardcoded. This is
an optimisation hack. If a document does neither use an optimisation hack. If a document does neither use
edit_workflow or processing_status_workflow, the edit_workflow or processing_status_workflow, the
...@@ -762,8 +764,8 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -762,8 +764,8 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
for wf in wf_list: for wf in wf_list:
history = wf.getInfoFor(self, 'history', None) history = wf.getInfoFor(self, 'history', None)
if history: if history:
return len(filter(lambda x:x.get('action', None) in ('edit', 'upload'), history)) return str(len(filter(lambda x:x.get('action', None) in ('edit', 'upload'), history)))
return None return ''
security.declareProtected(Permissions.AccessContentsInformation, 'getRevisionList') security.declareProtected(Permissions.AccessContentsInformation, 'getRevisionList')
def getRevisionList(self): 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