From 116fb5155da9c092bef7773e8017787c1895edc9 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 25 Apr 2017 16:44:09 -0400 Subject: [PATCH] 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 --- mayan/apps/documents/links.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mayan/apps/documents/links.py b/mayan/apps/documents/links.py index d33002f4d0..351a1b04ad 100644 --- a/mayan/apps/documents/links.py +++ b/mayan/apps/documents/links.py @@ -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):