I have many token_hex in my database to which I want to send multicast. But it is possible to have invalid token_hex values (as I get them through an API), due to which I need to set enhanced = False in my code. Setting it to True stops sending the multicast without any Exception. So when enhanced = False, I get the error
AttributeError: 'GatewayConnection' object has no attribute '_sent_notifications'
in sending multicast (send_notification_multiple) as _sent_notifications is not initialized when self.enhanced is not set to True in class GatewayConnection.
Fixed by putting self._sent_notifications initialization outside self.enhanced == True check in the GatewayConnection class.
I have many
token_hex
in my database to which I want to send multicast. But it is possible to have invalid token_hex values (as I get them through an API), due to which I need to setenhanced = False
in my code. Setting it toTrue
stops sending the multicast without any Exception. So whenenhanced = False
, I get the errorAttributeError: 'GatewayConnection' object has no attribute '_sent_notifications'
in sending multicast (send_notification_multiple) as_sent_notifications
is not initialized whenself.enhanced
is not set toTrue
inclass GatewayConnection
.Fixed by putting
self._sent_notifications
initialization outsideself.enhanced == True
check in theGatewayConnection
class.