Skip to content

Commit

Permalink
Make python-postmonkey not a required package.
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
timabbott committed Sep 25, 2015
1 parent a0006d5 commit ae4cb6d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion puppet/zulip/manifests/app_frontend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
# 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",
Expand Down
8 changes: 5 additions & 3 deletions zerver/worker/queue_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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
Expand Down Expand Up @@ -83,18 +82,21 @@ def start(self):
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,
Expand Down
1 change: 0 additions & 1 deletion zproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def get_secret(key):
'S3_SECRET_KEY': '',
'S3_BUCKET': '',
'S3_AVATAR_BUCKET': '',
'MAILCHIMP_API_KEY': '',
'LOCAL_UPLOADS_DIR': None,
'DROPBOX_APP_KEY': '',
'ERROR_REPORTING': True,
Expand Down

0 comments on commit ae4cb6d

Please sign in to comment.