Only send waitlist email once per application
Submitted in my capacity as a volunteer :)
Description
I added a new field to the application model to track whether we sent a waitlist email for that application, set it to True when the email is sent, and checked for it in the relevant email task.
Rationale
We shouldn't send users multiple waitlist emails if a partner gets switched back and forth between waitlisted and available, as happens for busy proxy partners which have authorizations expiring on a regular basis.
Phabricator Ticket
https://phabricator.wikimedia.org/T304512
How Has This Been Tested?
I added a test, which was failing before I made the code changes (2 emails sent instead of the desired 1).
Types of changes
What types of changes does your code introduce? Add an x in all the boxes that apply:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Minor change (fix a typo, add a translation tag, add section to README, etc.)
Hi, volunteer Sam :) Can you please pull the latest changes from the master branch and rebase this PR?
Looks like the build is erroring out on a test.
I think I see the source of the issue - we've got circular signalling because I added a .save() in a function called by the signal, which prompts the signal again, ad infinitum.