Update the document version link's current version conditional to

work in all cases: when the document version is an object
of a list (versions list) and when it is the context object
(signatures list).
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-04-25 16:44:09 -04:00
parent 7a0c2224bb
commit 116fb5155d

View File

@@ -20,7 +20,14 @@ from .settings import setting_zoom_max_level, setting_zoom_min_level
def is_not_current_version(context):
return context['object'].document.latest_version.timestamp != context['object'].timestamp
# Use the 'object' key when the document version is an object in a list,
# such as when showing the version list view and use the 'resolved_object'
# when the document version is the context object, such as when showing the
# signatures list of a documern version. This can be fixed by updating
# the navigations app object resolution logic to use 'resolved_object' even
# for objects in a list.
document_version = context.get('object', context['resolved_object'])
return document_version.document.latest_version.timestamp != document_version.timestamp
def is_first_page(context):