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.