mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-04 04:12:08 +02:00
Add update note menu
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from typing import Union
|
||||
|
||||
from participation.models import Participation, Team
|
||||
from participation.models import Note, Participation, Passage, Pool, Team
|
||||
from tfjm.lists import get_sympa_client
|
||||
|
||||
|
||||
@ -33,3 +34,13 @@ 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 create_notes(instance: Union[Passage, Pool], **_):
|
||||
if isinstance(instance, Pool):
|
||||
for passage in instance.passages.all():
|
||||
create_notes(passage)
|
||||
return
|
||||
|
||||
for jury in instance.pool.juries.all():
|
||||
Note.objects.get_or_create(jury=jury, passage=instance)
|
||||
|
Reference in New Issue
Block a user