When creating notifications of a specific NotificationType, subscriptions to that NotificationType with an empty object_id will not receive any notifications.
The reasons seems to be that the above-mentioned line is filtering these subscriptions out. Subscription.object_id is a CharField, and thus will have a value of "" (not None) when empty.
Changing the above line to Q(object_id="") resolves the issue.
On line 242 in models.py: https://github.com/benjaoming/django-nyt/blob/master/django_nyt/models.py#L242
When creating notifications of a specific
NotificationType
, subscriptions to thatNotificationType
with an emptyobject_id
will not receive any notifications.The reasons seems to be that the above-mentioned line is filtering these subscriptions out.
Subscription.object_id
is aCharField
, and thus will have a value of""
(notNone
) when empty.Changing the above line to
Q(object_id="")
resolves the issue.