bugfix: fix login by avoiding sending notification on new Session
This commit is contained in:
parent
6b6a5e1e8c
commit
2a4550ae7b
@ -2,6 +2,8 @@ import requests
|
|||||||
import logging
|
import logging
|
||||||
import datetime
|
import datetime
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
from django.contrib.sessions.models import Session
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from djangoldp.fields import LDPUrlField
|
from djangoldp.fields import LDPUrlField
|
||||||
@ -45,7 +47,7 @@ class Subscription(models.Model):
|
|||||||
# --- SUBSCRIPTION SYSTEM ---
|
# --- SUBSCRIPTION SYSTEM ---
|
||||||
@receiver(post_save, dispatch_uid="callback_notif")
|
@receiver(post_save, dispatch_uid="callback_notif")
|
||||||
def send_notification(sender, instance, **kwargs):
|
def send_notification(sender, instance, **kwargs):
|
||||||
if (sender != Notification and sender != LogEntry):
|
if (sender != Notification and sender != LogEntry and sender != Session):
|
||||||
threads = []
|
threads = []
|
||||||
url = settings.BASE_URL + Model.resource_id(instance) + '/'
|
url = settings.BASE_URL + Model.resource_id(instance) + '/'
|
||||||
for subscription in Subscription.objects.filter(object=url):
|
for subscription in Subscription.objects.filter(object=url):
|
||||||
|
Loading…
Reference in New Issue
Block a user