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 <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-06 03:04:53 -04:00
parent d6435b7735
commit ef126d56b2

View File

@@ -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
)