bugfix: fix login by avoiding sending notification on new Token

This commit is contained in:
Jean-Baptiste 2019-03-06 13:31:52 +01:00
parent 2a4550ae7b
commit b441437588
1 changed files with 3 additions and 1 deletions

View File

@ -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):