GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 531f41...661b81 )
by Chathan
01:10
created

send_notifications()   A

Complexity

Conditions 3

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 8
rs 9.4285
cc 3
1
from django.db.models.signals import post_save
2
from django.dispatch import receiver
3
4
from simple_forums.notifications import models
5
6
7
@receiver(post_save, sender='simple_forums.Message')
8
def send_notifications(sender, instance, created, *args, **kwargs):
9
    """ Notify users that a reply has been posted """
10
    if created:
11
        message = instance
12
        thread = message.thread
13
        for n in models.ThreadNotification.objects.filter(thread=thread):
14
            n.send_notification(message)
15