forked from ScoDoc/ScoDoc
inscription étudiant: rapproche invalidation cache
This commit is contained in:
parent
7c6a3503a0
commit
aae5068b7e
@ -1143,12 +1143,12 @@ class FormSemestre(models.ScoDocModel):
|
|||||||
msg=f"inscription en semestre {self.titre_annee()}",
|
msg=f"inscription en semestre {self.titre_annee()}",
|
||||||
commit=True,
|
commit=True,
|
||||||
)
|
)
|
||||||
|
sco_cache.invalidate_formsemestre(formsemestre_id=self.id)
|
||||||
log(
|
log(
|
||||||
f"inscrit_etudiant: {etud.nomprenom} ({etud.id}) au semestre {self.titre_annee()}"
|
f"inscrit_etudiant: {etud.nomprenom} ({etud.id}) au semestre {self.titre_annee()}"
|
||||||
)
|
)
|
||||||
# Notification mail
|
# Notification mail
|
||||||
self._notify_inscription(etud)
|
self._notify_inscription(etud)
|
||||||
sco_cache.invalidate_formsemestre(formsemestre_id=self.id)
|
|
||||||
return inscr
|
return inscr
|
||||||
|
|
||||||
def desinscrit_etudiant(self, etud: Identite):
|
def desinscrit_etudiant(self, etud: Identite):
|
||||||
@ -1167,11 +1167,11 @@ class FormSemestre(models.ScoDocModel):
|
|||||||
msg=f"désinscription semestre {self.titre_annee()}",
|
msg=f"désinscription semestre {self.titre_annee()}",
|
||||||
commit=True,
|
commit=True,
|
||||||
)
|
)
|
||||||
|
sco_cache.invalidate_formsemestre(formsemestre_id=self.id)
|
||||||
log(
|
log(
|
||||||
f"desinscrit_etudiant: {etud.nomprenom} ({etud.id}) au semestre {self.titre_annee()}"
|
f"desinscrit_etudiant: {etud.nomprenom} ({etud.id}) au semestre {self.titre_annee()}"
|
||||||
)
|
)
|
||||||
self._notify_inscription(etud, action="désinscrit")
|
self._notify_inscription(etud, action="désinscrit")
|
||||||
sco_cache.invalidate_formsemestre(formsemestre_id=self.id)
|
|
||||||
|
|
||||||
def _notify_inscription(self, etud: Identite, action="inscrit") -> None:
|
def _notify_inscription(self, etud: Identite, action="inscrit") -> None:
|
||||||
"Notifie inscription d'un étudiant: envoie un mail selon paramétrage"
|
"Notifie inscription d'un étudiant: envoie un mail selon paramétrage"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user