Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of missing uploaded files for bulk registration.
When used with a browser, the support for uploading photos as part of bulk registration resulted in errors when a ZIP file was not uploaded. This did not show up in testing because MechanicalSoup versions 0.11 and earlier do not handle missing file uploads the same way as a browser does <MechanicalSoup/MechanicalSoup#250>. Similar issues apply when no CSV file is uploaded (should produce an error, did not with a browser). This change fixes the code handling uploads to handle empty filenames, as used by browsers when no file is uploaded, the same as the form field for the upload being missing, with consequent changes to handle the case of empty zip_ref following a missing ZIP upload. Tests are added for the browser-like case of missing CSV uploads, though those are only properly effective with newer MechanicalSoup. This passes testing with both older and newer MechanicalSoup.
- Loading branch information
Showing
3 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters