--- a/src/pyams_sequence/reference.py Thu Aug 23 13:52:05 2018 +0200
+++ b/src/pyams_sequence/reference.py Mon Aug 27 11:48:25 2018 +0200
@@ -99,9 +99,9 @@
def get_version_in_state(content, state):
"""Check for versions in given status"""
if handle_workflow and (IWorkflowVersion.providedBy(content) or IWorkflowManagedContent.providedBy(content)):
- versions = IWorkflowVersions(content).get_versions(state)
+ versions = IWorkflowVersions(content).get_versions(state, sort=True)
if versions:
- content = versions[0]
+ content = versions[-1]
if ISequentialIdInfo(content, None) is not None:
return content
else: