Skip to content
Snippets Groups Projects
Commit f92df0e8 authored by vuillaut's avatar vuillaut
Browse files

fix issue with new deposit and getting status code

parent 1b54b515
No related branches found
No related tags found
1 merge request!33fix issue with new deposit and getting status code
Pipeline #136876 passed
......@@ -136,7 +136,7 @@ class ZenodoAPI:
with open(path_file, 'rb') as upload_file:
upload = requests.put(url, data=upload_file, params=self.parameters)
return upload.json()
return upload
def update_metadata_entry(self, entry_id, json_metadata):
"""
......@@ -159,8 +159,7 @@ class ZenodoAPI:
# Thus the root 'metadata' key need to be kept, to indicate the field to be updated.
data = {"metadata": json_metadata}
return requests.put(url, data=json.dumps(data),
headers=headers, params=self.parameters)
return requests.put(url, data=json.dumps(data), headers=headers, params=self.parameters)
def erase_entry(self, entry_id):
"""
......
......@@ -95,7 +95,7 @@ def main():
path_file=full_path_file
)
status = ZenodoHTTPStatus(new_upload['status_code'], new_upload)
status = ZenodoHTTPStatus(new_upload.status_code, new_upload.json())
print(f"{status}\n * File {file} correctly uploaded")
......
......@@ -105,7 +105,7 @@ def main():
path_file=full_path_file
)
status = ZenodoHTTPStatus(new_upload['status_code'], new_upload)
status = ZenodoHTTPStatus(new_upload.status_code, new_upload.json())
print(f"{status}\n * File {file} correctly uploaded")
# 3 - Look for a zenodo metadata file, otherwise try to create one
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment