Update document parsing app

Update URL parameters to the "_id" forms. Add keyword arguments.
Remove use of is_path in the DOCUMENT_PARSING_PDFTOTEXT_PATH
setting.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-01-21 00:29:28 -04:00
parent fc29309f68
commit c0b34067ef
11 changed files with 75 additions and 71 deletions

View File

@@ -17,7 +17,7 @@ class APIDocumentPageContentView(generics.RetrieveAPIView):
"""
Returns the content of the selected document page.
"""
lookup_url_kwarg = 'page_pk'
lookup_url_kwarg = 'document_page_id'
mayan_object_permissions = {
'GET': (permission_content_view,),
}
@@ -25,11 +25,12 @@ class APIDocumentPageContentView(generics.RetrieveAPIView):
serializer_class = DocumentPageContentSerializer
def get_document(self):
return get_object_or_404(klass=Document, pk=self.kwargs['document_pk'])
return get_object_or_404(klass=Document, pk=self.kwargs['document_id'])
def get_document_version(self):
return get_object_or_404(
klass=self.get_document().versions.all(), pk=self.kwargs['version_pk']
klass=self.get_document().versions.all(),
pk=self.kwargs['document_version_id']
)
def get_queryset(self):