From b8eb8ee54af287b334d25ded71c68ea27dad76cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 9 Sep 2019 15:31:29 +0200 Subject: [PATCH] pwa: don't crash if X.962 serialization is not available (#35954) --- combo/apps/pwa/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/combo/apps/pwa/views.py b/combo/apps/pwa/views.py index 6eb6c792..d8b37856 100644 --- a/combo/apps/pwa/views.py +++ b/combo/apps/pwa/views.py @@ -47,7 +47,7 @@ def js_response(request, template_name, **kwargs): template = get_template(template_name) pwa_vapid_public_key = None pwa_settings = PwaSettings.singleton() - if pwa_settings.push_notifications: + if pwa_settings.push_notifications and hasattr(serialization.Encoding, 'X962'): if settings.PWA_VAPID_PUBLIK_KEY: # legacy pwa_vapid_public_key = settings.PWA_VAPID_PUBLIK_KEY else: