From 820262efedbd71d38e62320b561c4aaed95b1131 Mon Sep 17 00:00:00 2001 From: sevdog Date: Fri, 23 Feb 2024 15:55:59 +0100 Subject: [PATCH] Do not import fcm module at top level in models.py --- push_notifications/models.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/push_notifications/models.py b/push_notifications/models.py index 876ce452..33f44205 100644 --- a/push_notifications/models.py +++ b/push_notifications/models.py @@ -58,9 +58,7 @@ def get_queryset(self): class GCMDeviceQuerySet(models.query.QuerySet): def send_message(self, message, **kwargs): if self.exists(): - from firebase_admin import messaging - - from .gcm import dict_to_fcm_message + from .gcm import dict_to_fcm_message, messaging from .gcm import send_message as fcm_send_message if not isinstance(message, messaging.Message): @@ -109,9 +107,7 @@ class Meta: verbose_name = _("FCM device") def send_message(self, message, **kwargs): - from firebase_admin import messaging - - from .gcm import dict_to_fcm_message + from .gcm import dict_to_fcm_message, messaging from .gcm import send_message as fcm_send_message # GCM is not supported.