1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-05 07:14:08 +02:00

Display mailing list address on team page

This commit is contained in:
Yohann D'ANELLO
2020-10-20 15:32:13 +02:00
parent 8c8ab4c0b7
commit b80f98ef43
3 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,4 @@
import os
import re
from django.template.loader import render_to_string
@ -41,6 +42,10 @@ class Team(models.Model):
default=False,
)
@property
def email(self):
return f"equipe-{self.trigram.lower()}@{os.getenv('SYMPA_HOST', 'localhost')}"
def create_mailing_list(self):
get_sympa_client().create_list(
f"equipe-{self.trigram.lower()}",