mirror of https://github.com/zulip/zulip.git
Make python-postmonkey not a required package.
This is in some ways a regression, but because we don't have python-postmonkey packaged right now, this is required to make the Zulip production installation process work on Trusty. (imported from commit 539d253eb7fedc20bf02cc1f0674e9345beebf48)
This commit is contained in:
parent
a0006d5faf
commit
ae4cb6df35
|
@ -48,7 +48,6 @@ class zulip::app_frontend {
|
|||
# Needed for S3 file uploads
|
||||
"python-boto",
|
||||
# Needed to send email
|
||||
"python-postmonkey",
|
||||
"python-mandrill",
|
||||
# Needed to generate diffs for edits
|
||||
"python-diff-match-patch",
|
||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import absolute_import
|
|||
from django.conf import settings
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.handlers.base import BaseHandler
|
||||
from postmonkey import PostMonkey, MailChimpException
|
||||
from zerver.models import get_user_profile_by_email, \
|
||||
get_user_profile_by_id, get_prereg_user_by_email, get_client
|
||||
from zerver.lib.context_managers import lockfile
|
||||
|
@ -83,18 +82,21 @@ class QueueProcessingWorker(object):
|
|||
def stop(self):
|
||||
self.q.stop_consuming()
|
||||
|
||||
if settings.MAILCHIMP_API_KEY:
|
||||
from postmonkey import PostMonkey, MailChimpException
|
||||
|
||||
@assign_queue('signups')
|
||||
class SignupWorker(QueueProcessingWorker):
|
||||
def __init__(self):
|
||||
super(SignupWorker, self).__init__()
|
||||
if settings.MAILCHIMP_API_KEY != '':
|
||||
if settings.MAILCHIMP_API_KEY:
|
||||
self.pm = PostMonkey(settings.MAILCHIMP_API_KEY, timeout=10)
|
||||
|
||||
def consume(self, data):
|
||||
merge_vars=data['merge_vars']
|
||||
# This should clear out any invitation reminder emails
|
||||
clear_followup_emails_queue(data["EMAIL"])
|
||||
if settings.MAILCHIMP_API_KEY != '' and settings.PRODUCTION:
|
||||
if settings.MAILCHIMP_API_KEY and settings.PRODUCTION:
|
||||
try:
|
||||
self.pm.listSubscribe(
|
||||
id=settings.ZULIP_FRIENDS_LIST_ID,
|
||||
|
|
|
@ -119,7 +119,6 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
|||
'S3_SECRET_KEY': '',
|
||||
'S3_BUCKET': '',
|
||||
'S3_AVATAR_BUCKET': '',
|
||||
'MAILCHIMP_API_KEY': '',
|
||||
'LOCAL_UPLOADS_DIR': None,
|
||||
'DROPBOX_APP_KEY': '',
|
||||
'ERROR_REPORTING': True,
|
||||
|
|
Loading…
Reference in New Issue