TWLight icon indicating copy to clipboard operation
TWLight copied to clipboard

Only send waitlist email once per application

Open Samwalton9 opened this issue 3 years ago • 3 comments

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.)

Samwalton9 avatar Mar 26 '22 22:03 Samwalton9

Hi, volunteer Sam :) Can you please pull the latest changes from the master branch and rebase this PR?

suecarmol avatar Mar 29 '22 02:03 suecarmol

Looks like the build is erroring out on a test.

suecarmol avatar Apr 04 '22 18:04 suecarmol

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.

Samwalton9 avatar Apr 17 '22 11:04 Samwalton9