mirror of https://github.com/zulip/zulip.git
emails: Move enqueue_welcome_emails outside of signups queue.
The only thing this queue should do is sign you up for the newsletter, since it is only populated if newsletter_data is not None.
This commit is contained in:
parent
395a71a433
commit
a7c8770f97
|
@ -93,7 +93,8 @@ from zerver.lib.utils import log_statsd_event, statsd
|
||||||
from zerver.lib.html_diff import highlight_html_differences
|
from zerver.lib.html_diff import highlight_html_differences
|
||||||
from zerver.lib.alert_words import user_alert_words, add_user_alert_words, \
|
from zerver.lib.alert_words import user_alert_words, add_user_alert_words, \
|
||||||
remove_user_alert_words, set_user_alert_words
|
remove_user_alert_words, set_user_alert_words
|
||||||
from zerver.lib.notifications import clear_scheduled_emails, clear_scheduled_invitation_emails
|
from zerver.lib.notifications import clear_scheduled_emails, \
|
||||||
|
clear_scheduled_invitation_emails, enqueue_welcome_emails
|
||||||
from zerver.lib.narrow import check_supported_events_narrow_filter
|
from zerver.lib.narrow import check_supported_events_narrow_filter
|
||||||
from zerver.lib.exceptions import JsonableError, ErrorCode
|
from zerver.lib.exceptions import JsonableError, ErrorCode
|
||||||
from zerver.lib.sessions import delete_user_sessions
|
from zerver.lib.sessions import delete_user_sessions
|
||||||
|
@ -355,6 +356,7 @@ def process_new_human_user(user_profile, prereg_user=None, newsletter_data=None)
|
||||||
PreregistrationUser.objects.filter(email__iexact=user_profile.email).update(status=0)
|
PreregistrationUser.objects.filter(email__iexact=user_profile.email).update(status=0)
|
||||||
|
|
||||||
notify_new_user(user_profile)
|
notify_new_user(user_profile)
|
||||||
|
enqueue_welcome_emails(user_profile.id)
|
||||||
|
|
||||||
if newsletter_data is not None:
|
if newsletter_data is not None:
|
||||||
# If the user was created automatically via the API, we may
|
# If the user was created automatically via the API, we may
|
||||||
|
|
|
@ -314,7 +314,7 @@ class LoginTest(ZulipTestCase):
|
||||||
with queries_captured() as queries:
|
with queries_captured() as queries:
|
||||||
self.register(self.nonreg_email('test'), "test")
|
self.register(self.nonreg_email('test'), "test")
|
||||||
# Ensure the number of queries we make is not O(streams)
|
# Ensure the number of queries we make is not O(streams)
|
||||||
self.assert_length(queries, 63)
|
self.assert_length(queries, 68)
|
||||||
user_profile = self.nonreg_user('test')
|
user_profile = self.nonreg_user('test')
|
||||||
self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
|
self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
|
||||||
self.assertFalse(user_profile.enable_stream_desktop_notifications)
|
self.assertFalse(user_profile.enable_stream_desktop_notifications)
|
||||||
|
|
|
@ -167,8 +167,6 @@ class SignupWorker(QueueProcessingWorker):
|
||||||
else:
|
else:
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
enqueue_welcome_emails(data['user_id'])
|
|
||||||
|
|
||||||
@assign_queue('invites')
|
@assign_queue('invites')
|
||||||
class ConfirmationEmailWorker(QueueProcessingWorker):
|
class ConfirmationEmailWorker(QueueProcessingWorker):
|
||||||
def consume(self, data):
|
def consume(self, data):
|
||||||
|
|
Loading…
Reference in New Issue