fix: don't notify creation for fields subscription

This commit is contained in:
Jean-Baptiste Pasquier 2021-02-11 13:25:39 +01:00
parent e1832ca932
commit eb06f2c38c
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ def send_notification(sender, instance, **kwargs):
# I may have configured to send the subscription to a foreign key
if subscription.field is not None and len(subscription.field) > 1:
try:
if kwargs.get("created"):
continue
instance = getattr(instance, subscription.field, instance)
# don't send notifications for foreign resources