mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-05 02:06:52 +00:00
Delete related videos when a participation got deleted
This commit is contained in:
parent
9e097c99d0
commit
df74f499ec
@ -1,5 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
from django.db.models.signals import post_save, pre_save
|
||||
from django.db.models.signals import post_save, pre_delete, pre_save
|
||||
|
||||
|
||||
class ParticipationConfig(AppConfig):
|
||||
|
@ -23,3 +23,10 @@ def update_mailing_list(instance: Team, **_):
|
||||
for coach in instance.coachs.all():
|
||||
get_sympa_client().subscribe(coach.user.email, f"equipe-{instance.trigram.lower()}", False,
|
||||
f"{coach.user.first_name} {coach.user.last_name}")
|
||||
|
||||
|
||||
def delete_related_videos(instance: Participation, **_):
|
||||
if instance.solution:
|
||||
instance.solution.delete()
|
||||
if instance.synthesis:
|
||||
instance.synthesis.delete()
|
||||
|
Loading…
Reference in New Issue
Block a user