mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat: Gestion multi-profil multi-école
This commit is contained in:
@ -4,20 +4,20 @@ from .models import Notification, TypeNotif
|
||||
from GestionMessagerie.models import Messagerie
|
||||
from Subscriptions.models import RegistrationForm
|
||||
|
||||
@receiver(post_save, sender=Messagerie)
|
||||
def notification_MESSAGE(sender, instance, created, **kwargs):
|
||||
if created:
|
||||
Notification.objects.create(
|
||||
user=instance.destinataire,
|
||||
message=(TypeNotif.NOTIF_MESSAGE).label,
|
||||
typeNotification=TypeNotif.NOTIF_MESSAGE
|
||||
)
|
||||
# @receiver(post_save, sender=Messagerie)
|
||||
# def notification_MESSAGE(sender, instance, created, **kwargs):
|
||||
# if created:
|
||||
# Notification.objects.create(
|
||||
# user=instance.destinataire,
|
||||
# message=(TypeNotif.NOTIF_MESSAGE).label,
|
||||
# typeNotification=TypeNotif.NOTIF_MESSAGE
|
||||
# )
|
||||
|
||||
@receiver(post_save, sender=RegistrationForm)
|
||||
def notification_DI(sender, instance, created, **kwargs):
|
||||
for responsable in instance.student.guardians.all():
|
||||
Notification.objects.create(
|
||||
user=responsable.associated_profile,
|
||||
message=(TypeNotif.NOTIF_DI).label,
|
||||
typeNotification=TypeNotif.NOTIF_DI
|
||||
)
|
||||
# @receiver(post_save, sender=RegistrationForm)
|
||||
# def notification_DI(sender, instance, created, **kwargs):
|
||||
# for responsable in instance.student.guardians.all():
|
||||
# Notification.objects.create(
|
||||
# user=responsable.associated_profile,
|
||||
# message=(TypeNotif.NOTIF_DI).label,
|
||||
# typeNotification=TypeNotif.NOTIF_DI
|
||||
# )
|
||||
|
||||
Reference in New Issue
Block a user