Fix document check in via the API

- Closes GitLab issue #688. Thanks to inam ul haq (@inam.sys)
  for the report.
- Improve existing tests and add additional check in override tests.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-28 01:13:24 -04:00
parent 2119683246
commit 2d2cc4f75c
4 changed files with 113 additions and 50 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ class APICheckedoutDocumentView(generics.RetrieveDestroyAPIView):
def delete(self, request, *args, **kwargs):
document = self.get_object().document
if document.checkout_info().user == request.user:
if document.get_check_out_info().user == request.user:
AccessControlList.objects.check_access(
obj=document, permissions=(permission_document_check_in,),
user=request.user