Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Jun 18, 2023
1 parent 480d70c commit 07c8dde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/neurolibre_preprint_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def summary_pdf_sync_post(user,id):
response = requests.get(download_url)

if response.status_code == 200:
# Delete the old one if exists.
if os.path.exists(file_path):
os.remove(file_path)
with open(file_path, "wb") as file:
file.write(response.content)
result = make_response(jsonify(f"Synced the summary PDF from the [source]({download_url}), should be now avaiable at https://preprint.neurolibre.org/10.55458/neurolibre.{issue_id:05d}.pdf"),200)
Expand Down

0 comments on commit 07c8dde

Please sign in to comment.