diff --git a/swh/deposit/api/common.py b/swh/deposit/api/common.py --- a/swh/deposit/api/common.py +++ b/swh/deposit/api/common.py @@ -143,7 +143,7 @@ not stored in the same location or not properly formatted). Args: - request (Request): Input request + request: Input request Returns: Dictionary with the following keys (some associated values may be @@ -349,13 +349,16 @@ return {} def _check_preconditions_on( - self, filehandler, md5sum: Optional[bytes], content_length: Optional[int] = None + self, + filehandler: InMemoryUploadedFile, + md5sum: Optional[bytes], + content_length: Optional[int] = None, ) -> None: """Check preconditions on provided file are respected. That is the length and/or the md5sum hash match the file's content. Args: - filehandler (InMemoryUploadedFile): The file to check + filehandler: The file to check md5sum: md5 hash expected from the file's content content_length: the expected length if provided. @@ -402,15 +405,15 @@ Other than such a request, a 415 response is returned. Args: - request (Request): the request holding information to parse + request: the request holding information to parse and inject in db - headers (ParsedRequestHeaders): parsed request headers - collection_name (str): the associated client - deposit_id (id): deposit identifier if provided - replace_metadata (bool): 'Update or add' request to existing + headers: parsed request headers + collection_name: the associated client + deposit_id: deposit identifier if provided + replace_metadata: 'Update or add' request to existing deposit. If False (default), this adds new metadata request to existing ones. Otherwise, this will replace existing metadata. - replace_archives (bool): 'Update or add' request to existing + replace_archives: 'Update or add' request to existing deposit. If False (default), this adds new archive request to existing ones. Otherwise, this will replace existing archives. ones. @@ -509,7 +512,7 @@ Other than such a request, a 415 response is returned. Args: - request (Request): the request holding information to parse + request: the request holding information to parse and inject in db headers: parsed request headers collection_name: the associated client