a9b80fe2a59384b1ad1cfd738504ce899455a982 — Jochen Kupperschmidt a month ago 857f3fd
Require sender in `byceps.email.send`
1 files changed, 4 insertions(+), 4 deletions(-)

M byceps/email.py
M byceps/email.py => byceps/email.py +4 -4
@@ 9,11 9,13 @@ Sending e-mail.

from __future__ import annotations
from typing import Any, Optional
from typing import Any

from flask import current_app, Flask

# Hack to avoid import error in `marrow.util` on Python 3.8+.
import sys

sys.modules['cgi.parse_qsl'] = None
from marrow.mailer import Mailer

@@ 49,9 51,7 @@ def _get_config(app: Flask) -> dict[str, Any]:
    return config

def send(
    sender: Optional[str], recipients: list[str], subject: str, body: str
) -> None:
def send(sender: str, recipients: list[str], subject: str, body: str) -> None:
    """Assemble and send an e-mail."""
    if current_app.config.get('MAIL_SUPPRESS_SEND', False):
        current_app.logger.debug('Suppressing sending of email.')