feat: Gestion multi-profil multi-école

This commit is contained in:
N3WT DE COMPET
2025-03-09 16:22:28 +01:00
parent 95c154a4a2
commit 16178296ec
51 changed files with 1621 additions and 802 deletions

View File

@ -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
# )