mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat(backend): Ajout du logger django [#7]
This commit is contained in:
@ -8,7 +8,6 @@ from N3wtSchool import settings, bdd
|
||||
import requests
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.WARNING)
|
||||
|
||||
@shared_task
|
||||
def check_for_signature_deadlines():
|
||||
@ -17,12 +16,12 @@ def check_for_signature_deadlines():
|
||||
# deadline = now - timezone.timedelta(seconds=settings.EXPIRATION_DI_NB_DAYS)
|
||||
|
||||
dossiers_en_attente = FicheInscription.objects.filter(etat=FicheInscription.EtatDossierInscription.DI_ENVOYE, dateMAJ__lt=deadline)
|
||||
|
||||
|
||||
for dossier in dossiers_en_attente:
|
||||
send_notification(dossier)
|
||||
|
||||
def send_notification(dossier):
|
||||
print(f'Dossier en attente.... {dossier} - Positionnement à l\'état A_RELANCER')
|
||||
logger.debug(f'Dossier en attente.... {dossier} - Positionnement à l\'état A_RELANCER')
|
||||
|
||||
# Changer l'état de l'automate
|
||||
updateStateMachine(dossier, 'relanceDI')
|
||||
@ -32,7 +31,7 @@ def send_notification(dossier):
|
||||
destinataires = dossier.eleve.profils.all()
|
||||
for destinataire in destinataires:
|
||||
message = {
|
||||
"objet": "[RELANCE]",
|
||||
"objet": "[RELANCE]",
|
||||
"destinataire" : destinataire.id,
|
||||
"corpus": "RELANCE pour le dossier d'inscription"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user