From d27a9d4b1bc18618a0cf390a9f32dcaf4e99bffa Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 2 May 2024 21:42:30 +0300 Subject: [PATCH] fix: the message was sent to individual inactive device --- fcm_django/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fcm_django/models.py b/fcm_django/models.py index 515ade3..56eb412 100644 --- a/fcm_django/models.py +++ b/fcm_django/models.py @@ -310,6 +310,11 @@ def send_message( :returns messaging.SendResponse or FirebaseError if the device was deactivated due to an error. """ + if not self.active: + return messaging.SendResponse( + None, + None, + ) message.token = self.registration_id try: return messaging.SendResponse(