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.

send_notifications()   A
last analyzed

Complexity

Conditions 4

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 9
rs 9.2
cc 4
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
            if n.user != message.user:
15
                n.send_notification(message)
16