Conditions | 4 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | from django.db.models.signals import post_save |
||
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 |