mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 10:48:25 -04:00
Handle files that can’t be interpreted as spreadsheets
There shouldn’t be a case where we see a `ValueError` on upload any more. Our file handling should be robust enough to deal with whatever is thrown at it. This commit: - adds test files with bad data (PNG files with their extensions changed to look like spreadsheets) - catches whatever exceptions are raised by trying to parse these files - returns a helpful flash message to the user Anything else should raise a `500`, eg if the file can’t be uploaded to S3.
This commit is contained in:
BIN
tests/non_spreadsheet_files/actually_a_png.csv
Normal file
BIN
tests/non_spreadsheet_files/actually_a_png.csv
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
Reference in New Issue
Block a user