Add klass argument to get_object_or_404 usage

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-16 01:55:33 -04:00
parent 727d2ecd71
commit 798446f362
39 changed files with 164 additions and 164 deletions

View File

@@ -62,7 +62,7 @@ class APIIndexNodeInstanceDocumentListView(generics.ListAPIView):
def get_queryset(self):
index_node_instance = get_object_or_404(
IndexInstanceNode, pk=self.kwargs['pk']
klass=IndexInstanceNode, pk=self.kwargs['pk']
)
AccessControlList.objects.check_access(
permissions=permission_document_indexing_view,
@@ -109,7 +109,7 @@ class APIDocumentIndexListView(generics.ListAPIView):
serializer_class = IndexInstanceNodeSerializer
def get_queryset(self):
document = get_object_or_404(Document, pk=self.kwargs['pk'])
document = get_object_or_404(klass=Document, pk=self.kwargs['pk'])
AccessControlList.objects.check_access(
permissions=permission_document_view, user=self.request.user,
obj=document