Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate Batch Inventory Worksheet uploaded to ballot manifest #2021

Conversation

kshen0
Copy link
Contributor

@kshen0 kshen0 commented Oct 29, 2024

#1946

Returns a more specific error message when a Batch Inventory Worksheet is uploaded instead of ballot manifest.

Note that because CSV validation currently happens in upload before process(), it's easiest to trigger a toast notification rather than permanent job error under the upload field.

Screen.Recording.2024-10-30.at.4.11.13.PM.mov

Screenshot 2024-10-29 at 2 51 46 PM

@kshen0 kshen0 force-pushed the kevin/error-when-batch-inventory-sheet-uploaded-for-ballot-manifest branch 2 times, most recently from 7043903 to 5c8dfd2 Compare October 29, 2024 21:01
validate_csv_mimetype(request.files["manifest"])
file = request.files["manifest"]
validate_is_not_batch_inventory_worksheet(file)
validate_csv_mimetype(file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that because CSV validation currently happens in upload before process(), it's easiest to trigger a toast notification rather than permanent job error under the upload field.

This doesn't match my reading. I see CSV mimetype validation happening during the initial file upload, but the actual parsing of the CSV file seems to happen within the background task.

If possible, making this a file processing error would be best since it will be persistent in the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are absolutely right, sorry! Updated

@kshen0 kshen0 requested a review from jonahkagan October 29, 2024 21:59
@kshen0 kshen0 force-pushed the kevin/error-when-batch-inventory-sheet-uploaded-for-ballot-manifest branch from 945445b to dceec1e Compare October 30, 2024 22:55
@kshen0 kshen0 merged commit a16c8d8 into main Oct 30, 2024
5 checks passed
@kshen0 kshen0 deleted the kevin/error-when-batch-inventory-sheet-uploaded-for-ballot-manifest branch October 30, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants