-
Notifications
You must be signed in to change notification settings - Fork 50
Add command to resend verification emails #694
Conversation
API Developer Docs Preview: Ready https://wordpress.github.io/openverse-api/_preview/694 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the thorough tests! My comments are only minor, thank you for jumping on this 📧
|
||
redis = get_redis_connection("default") | ||
|
||
already_processed_emails = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic idea using redis to save this!
I actually got a bit anxious about this branch and the unit tests I wrote. I'd like to write some additional tests that use mocked requests to the verification endpoint instead of factories to generate the test data... I just want to make totally sure that it's working 😁 |
Fixes
Fixes #689 by @AetherUnbound
Description
Adds a new command to run for resending verification emails. Note: I haven't written unit tests for this but I need to stop working on this for the day and come back to it tomorrow. Just wanted to get a draft up early.
Testing Instructions
I tried to write comprehensive unit tests. If you notice a missing branch please let me know so I can add additional tests.
You can test this on your local API (though I'm hoping the unit tests are sufficient) by setting the email backend to SMTP in your API settings without filling in the SMTP server information and then making some registration requests with multiple application names. Use a mix of the same email and different emails. This will cause the verifications to be completed, but because we haven't filled in the SMTP server information, it will fail to send the email (which is what was happening in production).
Then switch your settings back to the Console email backend and run the management command. You should see some helpful logs throughout the way, but also you'll see the emails that would be sent pop into the console. It will look like this:
To run the command:
For a dry run:
For an actual run:
Note that the non-dry run requires you to input exactly
YES
as the response. Any other input includingyes
will not be accepted.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin