mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
[manual] Rename manage.py subscribe_new_users to process_signups.
The old name was very confusing, and this fits the convention of "the processor for the signups" queue a la "process_user_activity". This requires doing a supervisorctl stop humbug-workers:humbug-events-subscribe-new-users puppet apply to deploy the supervisord configuration changes and properly restart the signups queue. (imported from commit 0ee2dad837142afa64025446e22956709771a192)
This commit is contained in:
23
zephyr/management/commands/process_signups.py
Normal file
23
zephyr/management/commands/process_signups.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from postmonkey import PostMonkey
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.conf import settings
|
||||
|
||||
from zephyr.lib.queue import SimpleQueueClient
|
||||
|
||||
class Command(BaseCommand):
|
||||
pm = PostMonkey(settings.MAILCHIMP_API_KEY, timeout=10)
|
||||
|
||||
def subscribe(self, ch, method, properties, data):
|
||||
self.pm.listSubscribe(
|
||||
id=settings.HUMBUG_FRIENDS_LIST_ID,
|
||||
email_address=data['EMAIL'],
|
||||
merge_vars=data['merge_vars'],
|
||||
double_optin=False,
|
||||
send_welcome=False)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
q = SimpleQueueClient()
|
||||
q.register_json_consumer("signups", self.subscribe)
|
||||
q.start_consuming()
|
||||
Reference in New Issue
Block a user