Skip to content

Commit

Permalink
only create xlsx file if the csv file was created
Browse files Browse the repository at this point in the history
  • Loading branch information
reecehill committed Nov 13, 2024
1 parent 2bb1c16 commit 0106b6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions project/npda/general_functions/csv/csv_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ async def validate_rows_in_parallel(rows_by_patient, async_client):
except Exception as error:
errors_to_return[visit_row_index]["__all__"].append(error)

# Copy csv to a styled xlsx.
_ = write_errors_to_xlsx(errors_to_return, new_submission)
# Only create xlsx file if the csv file was created.
if new_submission.csv_file:
_ = write_errors_to_xlsx(errors_to_return, new_submission)

return errors_to_return

0 comments on commit 0106b6c

Please sign in to comment.