bugfix: Allow notification only for Model subclasses

This commit is contained in:
Jean-Baptiste 2019-03-19 15:31:27 +01:00
parent 6569dd63cd
commit eb1d32285e

View File

@ -54,7 +54,7 @@ class Subscription(Model):
# --- SUBSCRIPTION SYSTEM ---
@receiver(post_save, dispatch_uid="callback_notif")
def send_notification(sender, instance, **kwargs):
if (sender != Notification and sender != LogEntry and sender != Session and sender != Token):
if sender != Notification and isinstance(sender, Model):
threads = []
url = settings.BASE_URL + Model.resource_id(instance) + '/'
for subscription in Subscription.objects.filter(object=url):