Fix invalid email error in process_forms #19602
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since forever, we have occasionally had emails get submitted in forms that are later judged invalid by Poste. When Poste throws an exception about an invalid email, that completely stops our
process_forms
cron job and requires manual intervention to repair.This PR makes
process_forms
more robust so the entire job does not fail due to a single invalid email address.process_forms
now rescues from an "Invalid email address" exception from Poste and continues, marking the form as processed. (The same thing we do to repair manually.)This problem (though infrequent) occurs because we have different (and less stringent) email validation rules in place elsewhere on the site. We should consider tracking these down and making Poste and the rest of our site use the same validation rules. This fix is worth having even if we align the email validation as well, since the present behavior of one invalid entry making the whole process fail is not robust.