From b0dc882f7e03705f344d3aed5c685c20a5f13e2e Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 10 Nov 2013 11:36:33 -0500 Subject: [PATCH] localserver: Add support for not having an APNS_CERT_FILE. (imported from commit 42d8caebb3035bd9e6e19db6359cc33e8ab4f317) --- zerver/lib/push_notifications.py | 2 +- zproject/settings.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py index bf1a1f8c8d..1d748c9503 100644 --- a/zerver/lib/push_notifications.py +++ b/zerver/lib/push_notifications.py @@ -14,7 +14,7 @@ import base64, binascii, logging, os # for each request session = Session() connection = None -if os.path.exists(settings.APNS_CERT_FILE): +if settings.APNS_CERT_FILE is not None and os.path.exists(settings.APNS_CERT_FILE): connection = session.get_connection(settings.APNS_SANDBOX, cert_file=settings.APNS_CERT_FILE) def num_push_devices_for_user(user_profile): diff --git a/zproject/settings.py b/zproject/settings.py index 632ba66318..4a9f2d11bf 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -245,6 +245,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '', 'NEW_USER_BOT': None, 'NAGIOS_STAGING_SEND_BOT': None, 'NAGIOS_STAGING_RECEIVE_BOT': None, + 'APNS_CERT_FILE': None, 'ZULIP_ADMINISTRATOR': '' }