Minor changes and fixes.
This commit is contained in:
@@ -279,10 +279,11 @@ async def download_event_file(
|
||||
log.info(f'Full file path with subdirectory: {file_path_w_subdir}')
|
||||
|
||||
if os.path.exists(file_path_w_subdir):
|
||||
log.info('Hosted file found on server.')
|
||||
return FileResponse(file_path_w_subdir, filename=filename)
|
||||
else:
|
||||
log.error(f'The hosted file was not found on the server. Hash: {hash_sha256}')
|
||||
return mk_resp(data=False, status_code=400, response=commons.response, status_message='The hosted file was not found on the server.') # Bad Request
|
||||
return mk_resp(data=False, status_code=404, response=commons.response, status_message=f'The hosted file was not found on the server. Hash: {hash_sha256}') # Not Found
|
||||
# ### END ### API Event File ### download_event_file() ###
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user