bugfix: fix login by avoiding sending notification on new Session

This commit is contained in:
Jean-Baptiste 2019-03-06 12:35:54 +01:00
parent 6b6a5e1e8c
commit 2a4550ae7b

View File

@ -2,6 +2,8 @@ import requests
import logging
import datetime
from threading import Thread
from django.contrib.sessions.models import Session
from django.db import models
from django.conf import settings
from djangoldp.fields import LDPUrlField
@ -45,7 +47,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):
if (sender != Notification and sender != LogEntry and sender != Session):
threads = []
url = settings.BASE_URL + Model.resource_id(instance) + '/'
for subscription in Subscription.objects.filter(object=url):