From b441437588b5562eae50b3ab9e204ab7daf5d1fa Mon Sep 17 00:00:00 2001
From: Jean-Baptiste <bleme@pm.me>
Date: Wed, 6 Mar 2019 13:31:52 +0100
Subject: [PATCH] bugfix: fix login by avoiding sending notification on new
 Token

---
 djangoldp_notification/models.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/djangoldp_notification/models.py b/djangoldp_notification/models.py
index 92c33b2..5810302 100644
--- a/djangoldp_notification/models.py
+++ b/djangoldp_notification/models.py
@@ -6,6 +6,8 @@ from threading import Thread
 from django.contrib.sessions.models import Session
 from django.db import models
 from django.conf import settings
+from oidc_provider.models import Token
+
 from djangoldp.fields import LDPUrlField
 from django.db.models.signals import post_save
 from django.dispatch import receiver
@@ -47,7 +49,7 @@ class Subscription(models.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):
+    if (sender != Notification and sender != LogEntry and sender != Session and sender != Token):
         threads = []
         url = settings.BASE_URL + Model.resource_id(instance) + '/'
         for subscription in Subscription.objects.filter(object=url):
-- 
GitLab