Skip to content

Commit

Permalink
Fix trovi zenodo record URL (#172)
Browse files Browse the repository at this point in the history
* Fix trovi zenodo record URL
* Allow redirects when checking zenodo URL
  • Loading branch information
Mark-Powers authored Feb 26, 2024
1 parent 7579586 commit 6d9d097
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trovi/storage/backends/zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def new_deposition_version(

def to_record_url(self) -> str:
record = self.to_record()
return f"{settings.ZENODO_URL}/record/{record}"
return f"{settings.ZENODO_URL}/records/{record}"

def get_temporary_download_url(self) -> Optional[HttpDownloadLink]:
# Legacy archives will be archive.zip, so we have to determine which is right
Expand All @@ -283,7 +283,7 @@ def get_temporary_download_url(self) -> Optional[HttpDownloadLink]:
zip_url = f"{record_url}/files/archive.zip?download=1"

# See if the tar archive exists
tar_response = requests.head(tar_url)
tar_response = requests.head(tar_url, allow_redirects=True)
if tar_response.ok:
download_url = tar_url
else:
Expand Down

0 comments on commit 6d9d097

Please sign in to comment.