Merge pull request #2326 from bookwyrm-social/synchronous-confirmation-emails
Send confirmation emails directly, rather than with celery
This commit is contained in:
commit
641fc325b4
4 changed files with 5 additions and 4 deletions
|
@ -23,7 +23,7 @@ def email_confirmation_email(user):
|
||||||
data = email_data()
|
data = email_data()
|
||||||
data["confirmation_code"] = user.confirmation_code
|
data["confirmation_code"] = user.confirmation_code
|
||||||
data["confirmation_link"] = user.confirmation_link
|
data["confirmation_link"] = user.confirmation_link
|
||||||
send_email.delay(user.email, *format_email("confirm", data))
|
send_email(user.email, *format_email("confirm", data))
|
||||||
|
|
||||||
|
|
||||||
def invite_email(invite_request):
|
def invite_email(invite_request):
|
||||||
|
|
|
@ -20,6 +20,7 @@ from bookwyrm.tests.validate_html import validate_html
|
||||||
class RegisterViews(TestCase):
|
class RegisterViews(TestCase):
|
||||||
"""login and password management"""
|
"""login and password management"""
|
||||||
|
|
||||||
|
# pylint: disable=invalid-name
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""we need basic test data and mocks"""
|
"""we need basic test data and mocks"""
|
||||||
self.factory = RequestFactory()
|
self.factory = RequestFactory()
|
||||||
|
@ -382,6 +383,6 @@ class RegisterViews(TestCase):
|
||||||
"""try again"""
|
"""try again"""
|
||||||
request = self.factory.post("", {"email": "mouse@mouse.com"})
|
request = self.factory.post("", {"email": "mouse@mouse.com"})
|
||||||
request.user = self.anonymous_user
|
request.user = self.anonymous_user
|
||||||
with patch("bookwyrm.emailing.send_email.delay") as mock:
|
with patch("bookwyrm.emailing.send_email") as mock:
|
||||||
views.ResendConfirmEmail.as_view()(request)
|
views.ResendConfirmEmail.as_view()(request)
|
||||||
self.assertEqual(mock.call_count, 1)
|
self.assertEqual(mock.call_count, 1)
|
||||||
|
|
|
@ -7,7 +7,7 @@ upstream web {
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
location ~ ^/(login[^-]|password-reset|resend-link|2fa-check) {
|
location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) {
|
||||||
limit_req zone=loginlimit;
|
limit_req zone=loginlimit;
|
||||||
|
|
||||||
proxy_pass http://web;
|
proxy_pass http://web;
|
||||||
|
|
|
@ -41,7 +41,7 @@ server {
|
||||||
# root /var/www/certbot;
|
# root /var/www/certbot;
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# location ~ ^/(login[^-]|password-reset|resend-link|2fa-check) {
|
# location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) {
|
||||||
# limit_req zone=loginlimit;
|
# limit_req zone=loginlimit;
|
||||||
#
|
#
|
||||||
# proxy_pass http://web;
|
# proxy_pass http://web;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue