|
@@ -62,12 +62,11 @@ def check_document_access_permission():
|
|
|
# TODO: The commented line should be used once we fully transition to doc2
|
|
# TODO: The commented line should be used once we fully transition to doc2
|
|
|
# doc2 = Document2.objects.get_by_uuid(user=request.user, uuid=uuid, perm_type=None)
|
|
# doc2 = Document2.objects.get_by_uuid(user=request.user, uuid=uuid, perm_type=None)
|
|
|
doc2 = Document2.objects.filter(uuid=uuid).order_by('-last_modified').first()
|
|
doc2 = Document2.objects.filter(uuid=uuid).order_by('-last_modified').first()
|
|
|
-
|
|
|
|
|
- if doc2:
|
|
|
|
|
- if USE_NEW_EDITOR.get():
|
|
|
|
|
- doc2.can_read_or_exception(request.user)
|
|
|
|
|
- else:
|
|
|
|
|
- doc2.doc.get().can_read_or_exception(request.user)
|
|
|
|
|
|
|
+ if doc2:
|
|
|
|
|
+ if USE_NEW_EDITOR.get():
|
|
|
|
|
+ doc2.can_read_or_exception(request.user)
|
|
|
|
|
+ else:
|
|
|
|
|
+ doc2.doc.get().can_read_or_exception(request.user)
|
|
|
except Document2.DoesNotExist:
|
|
except Document2.DoesNotExist:
|
|
|
raise PopupException(_('Job with %(key)s=%(value)s does not exist') %
|
|
raise PopupException(_('Job with %(key)s=%(value)s does not exist') %
|
|
|
{'key': 'id' if doc_id else 'uuid', 'value': doc_id or uuid})
|
|
{'key': 'id' if doc_id else 'uuid', 'value': doc_id or uuid})
|