From 8a3f9c7e4e79f131b954dffcc6fb1c33effdc22e Mon Sep 17 00:00:00 2001 From: Michael Price Date: Fri, 9 Mar 2018 02:33:50 -0400 Subject: [PATCH] Don't scan documents without at least a version for duplicates. Signed-off-by: Michael Price --- HISTORY.rst | 3 ++- mayan/apps/documents/managers.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0679fa34ea..e36228f633 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -30,7 +30,8 @@ Next (2018-XX-XX) - Add periodic AJAX workers to update the value of the notifications link. - Add notification count inside a badge on the notification link. - Add the MERC specifying javascript library usage. - +- Documents without at least a version are not scanned for duplicates. + 2.8 (2018-02-27) ================ - Rename the role groups link label from "Members" to "Groups". diff --git a/mayan/apps/documents/managers.py b/mayan/apps/documents/managers.py index 9a217d72dd..652f32d134 100644 --- a/mayan/apps/documents/managers.py +++ b/mayan/apps/documents/managers.py @@ -116,6 +116,9 @@ class DuplicatedDocumentManager(models.Manager): """ Find duplicates by matching latest version checksums """ + if not document.latest_version: + return None + Document = apps.get_model( app_label='documents', model_name='Document' )