Skip to content

Commit

Permalink
Do not import fcm module at top level in models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sevdog authored and 50-Course committed Feb 27, 2024
1 parent 9fbab31 commit 820262e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions push_notifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 820262e

Please sign in to comment.