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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user