This pull request modifies the code to verify that email addresses are valid before saving request documents.
š Motivation and context
Resolves #94.
š§Ŗ Testing
I deployed this change to database1.prod-a.cyhy, exported a customer with cyhy-export, then tinkered with the email addresses and attempted to import said customer via cyhy-import. WHen I used an valid email address the import was successful and when I used an invalid email address the import failed with an error similar to the following:
$ cyhy-import --force REDACTED.json
Traceback (most recent call last):
File "/usr/local/bin/cyhy-import", line 186, in <module>
main()
File "/usr/local/bin/cyhy-import", line 177, in main
success = import_file(db, args["FILE"], args["--force"], args["--init-stage"])
File "/usr/local/bin/cyhy-import", line 158, in import_file
return import_request(db, request, filename, force, init_stage)
File "/usr/local/bin/cyhy-import", line 145, in import_request
doc.save()
File "/usr/local/lib/python2.7/dist-packages/cyhy/db/database.py", line 1310, in save
raise ValueError(email_address + " is not a valid email address")
ValueError: redacted@@redacted.com is not a valid email address
ā Pre-approval checklist
[x] This PR has an informative and human-readable title.
[x] Changes are limited to a single goal - eschew scope creep!
[x] All relevant type-of-change labels have been added.
š£ Description
This pull request modifies the code to verify that email addresses are valid before saving request documents.
š Motivation and context
Resolves #94.
š§Ŗ Testing
I deployed this change to
database1.prod-a.cyhy
, exported a customer withcyhy-export
, then tinkered with the email addresses and attempted to import said customer viacyhy-import
. WHen I used an valid email address the import was successful and when I used an invalid email address the import failed with an error similar to the following:ā Pre-approval checklist
ā Post-merge checklist
database1.prod-a.cyhy
.