Commit 8b3e1c57 authored by tlc@toybox's avatar tlc@toybox
Browse files

Use /entries/<entry_id>/archive endpoint when upload id is None

parent 95ddcd88
Pipeline #132306 passed with stages
in 34 minutes and 15 seconds
......@@ -302,7 +302,10 @@ class ClientContext(Context):
def load_archive(self, entry_id: str, upload_id: str, installation_url: str) -> EntryArchive:
# TODO currently upload_id might be None
url = f'{_validate_url(installation_url)}/uploads/{upload_id}/archive/{entry_id}'
if upload_id is None:
url = f'{_validate_url(installation_url)}/entries/{entry_id}/archive'
else:
url = f'{_validate_url(installation_url)}/uploads/{upload_id}/archive/{entry_id}'
from nomad.client import Auth
response = requests.get(url, auth=Auth(user=self._user, password=self._password))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment