bugfix: fix login by avoiding sending notification on new Session
This commit is contained in:
		@ -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):
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user