From ef126d56b2cae18dc5b06957bfed826df948eca2 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 6 Dec 2018 03:04:53 -0400 Subject: [PATCH] Documents: Allow version upload task stubs access Update which Document model manager the new version upload task uses to fetch the document. Changing to the passthrough manager allows the task to access document stubs which is the expected behavior as new document with no versions are considered stubs. Signed-off-by: Roberto Rosario --- mayan/apps/documents/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mayan/apps/documents/tasks.py b/mayan/apps/documents/tasks.py index 0c12091291..19694d1abd 100644 --- a/mayan/apps/documents/tasks.py +++ b/mayan/apps/documents/tasks.py @@ -179,7 +179,7 @@ def task_upload_new_version(self, document_id, shared_uploaded_file_id, user_id, ) try: - document = Document.objects.get(pk=document_id) + document = Document.passthrough.get(pk=document_id) shared_file = SharedUploadedFile.objects.get( pk=shared_uploaded_file_id )