Skip to content

Commit

Permalink
Change logging for organization update
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Aug 22, 2024
1 parent ecbdddd commit eb9c97b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/hub/workers/update_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def copy_file_to_organization(organization: Organization, signed_file_url: str,
if not filename and getattr(organization, file_type):
getattr(organization, file_type).delete()
error_message = f"ERROR: {file_type.upper()} file URL is empty, deleting the existing file."
logger.error(error_message)
logger.warning(error_message)
return error_message

if not filename:
error_message = f"ERROR: {file_type.upper()} file URL is empty, but is a required field."
logger.error(error_message)
logger.warning(error_message)
return error_message

if filename == organization.filename_cache.get(file_type, ""):
Expand All @@ -59,7 +59,7 @@ def copy_file_to_organization(organization: Organization, signed_file_url: str,
if r.status_code != requests.codes.ok:
logger.info(f"{file_type.upper()} file request status = {r.status_code}")
error_message = f"ERROR: Could not download {file_type} file from NGO Hub, error status {r.status_code}."
logger.error(error_message)
logger.warning(error_message)
return error_message

extension: str = mimetypes.guess_extension(r.headers["content-type"])
Expand Down

0 comments on commit eb9c97b

Please sign in to comment.