mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-10-31 15:40:01 +01:00 
			
		
		
		
	Clôture des listes Sympa
This commit is contained in:
		| @@ -165,6 +165,20 @@ Ne pas oublier de partager le dossier en écriture à l'adresse | ||||
| ``plateforme-tfjm@plateforme-tfjm.iam.gserviceaccount.com``. | ||||
|  | ||||
|  | ||||
| Anciennes listes de diffusion | ||||
| """"""""""""""""""""""""""""" | ||||
|  | ||||
| Les listes Sympa doivent être fermées pour être correctement recréées. Un script permet | ||||
| de supprimer toutes les listes commençant par ``equipe``, ``orga`` ou ``jury`` : | ||||
|  | ||||
| .. code:: bash | ||||
|  | ||||
|    ./manage.py delete_old_sympa_lists | ||||
|  | ||||
| Attention : les listes closes ne sont pas supprimées. Rendez-vous sur la page | ||||
| `https://lists.tfjm.org/sympa/get_closed_lists`_ pour supprimer les listes ainsi fermées. | ||||
|  | ||||
|  | ||||
| À la fin du tournoi | ||||
| ------------------- | ||||
|  | ||||
|   | ||||
							
								
								
									
										28
									
								
								participation/management/commands/delete_old_sympa_lists.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								participation/management/commands/delete_old_sympa_lists.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| # Copyright (C) 2025 by Animath | ||||
| # SPDX-License-Identifier: GPL-3.0-or-later | ||||
| from django.conf import settings | ||||
| from django.core.management import BaseCommand | ||||
| from django.db.models import Q | ||||
| from django.template.defaultfilters import slugify | ||||
| from participation.models import Team, Tournament | ||||
| from registration.models import ParticipantRegistration, VolunteerRegistration | ||||
| from tfjm.lists import get_sympa_client | ||||
|  | ||||
|  | ||||
| class Command(BaseCommand): | ||||
|     def handle(self, *args, **options): | ||||
|         """ | ||||
|         Supprime les listes de diffusion Sympa. | ||||
|         Toutes les listess commençant par "equipe", "orga" ou "jury" sont fermées. | ||||
|         Attention : la fermeture n'est pas définitive, il faut ensuite se rendre sur Sympa | ||||
|         pour supprimer les listes fermées. | ||||
|         """ | ||||
|         if not settings.ML_MANAGEMENT: | ||||
|             return | ||||
|  | ||||
|         sympa = get_sympa_client() | ||||
|  | ||||
|     for mailing_list in sympa.all_lists(): | ||||
|         address = mailing_list.list_address | ||||
|         if address.startswith("equipe") or address.startswith("orga") or address.startswith("jury"): | ||||
|             sympa.delete_list(address) | ||||
		Reference in New Issue
	
	Block a user