Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

push_notifications: Update for breaking change in aioapns 4.0.

Alex Vandiver359939ba77a4
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index b36393ddf5d..bcf9909b577 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -182,9 +182,13 @@ def get_apns_context() -> APNsContext | None:
pass # nocoverage
async def make_apns() -> aioapns.APNs:
+ key: str | None = None
+ if settings.APNS_TOKEN_KEY_FILE: # nocoverage
+ with open(settings.APNS_TOKEN_KEY_FILE) as f:
+ key = f.read()
return aioapns.APNs(
client_cert=settings.APNS_CERT_FILE,
- key=settings.APNS_TOKEN_KEY_FILE,
+ key=key,
key_id=settings.APNS_TOKEN_KEY_ID,
team_id=settings.APNS_TEAM_ID,
max_connection_attempts=APNS_MAX_RETRIES,