bugfix: Allow notification only for Model subclasses
This commit is contained in:
parent
6569dd63cd
commit
eb1d32285e
@ -54,7 +54,7 @@ class Subscription(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 and sender != Session and sender != Token):
|
if sender != Notification and isinstance(sender, Model):
|
||||||
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…
x
Reference in New Issue
Block a user