From 7d51cb721ffa4256f2b34f64b8f60c6fafff9661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20D=C3=BCster?= Date: Mon, 5 Feb 2024 22:10:37 +0100 Subject: [PATCH] Stop hardcoding agdsn.me --- sipa/blueprints/usersuite.py | 2 +- sipa/forms.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sipa/blueprints/usersuite.py b/sipa/blueprints/usersuite.py index 2e576a64..093e0db1 100644 --- a/sipa/blueprints/usersuite.py +++ b/sipa/blueprints/usersuite.py @@ -190,7 +190,7 @@ def subscribe(): email = current_user.mail.raw_value if email == "": - email = f"{current_user.login.raw_value}@agdsn.me" + email = f"{current_user.login.raw_value}@{current_user.datasource.mail_server}" result = subscribe_to_status_page( current_app.config['STATUS_PAGE_API_SUBSCRIBE_ENDPOINT'], diff --git a/sipa/forms.py b/sipa/forms.py index ee586ca8..9fed5cc5 100644 --- a/sipa/forms.py +++ b/sipa/forms.py @@ -238,10 +238,15 @@ class ChangeMailForm(FlaskForm): validators=[DataRequired(lazy_gettext("Passwort nicht angegeben!"))]) email = EmailField(label=lazy_gettext("E-Mail-Adresse")) forwarded = BooleanField( - label=LocalProxy(lambda: - lazy_gettext("Mails für mein AG DSN E-Mail-Konto ({agdsn_email}) an private " - "E-Mail-Adresse weiterleiten") - .format(agdsn_email=f'{current_user.login.value}@agdsn.me'))) + label=LocalProxy( + lambda: lazy_gettext( + "Mails für mein AG DSN E-Mail-Konto ({agdsn_email}) an private " + "E-Mail-Adresse weiterleiten" + ).format( + agdsn_email=f"{current_user.login.value}@{current_user.datasource.mail_server}" + ) + ) + ) def require_unicast_mac(form, field):