• 2.31.0 b9ea727551

    2.31.0
    All checks were successful
    Build and push image / build-and-push (push) Successful in 1m58s
    Python FastAPI Jinja Linting / build (push) Successful in 29s
    Tests / pytest (push) Successful in 16s
    Stable

    johnsturgeon released this 2026-09-06 21:39:52 +02:00 | 87 commits to main since this release

    Expand {{ standings }} token in admin emails to a styled table

    What

    Adds a <!-- STANDINGS --> token to the admin custom-email composer. When present in the Markdown body, it expands to the current standings as an inline-styled HTML table that mirrors the /standings page — gray header, zebra rows, maroon names — styled inline so it survives email clients (no external CSS, no <style> block).

    No UI change to the compose page beyond one new row in the Markdown cheat sheet documenting the token.

    How

    • app/standings_email.py (new): standings_markdown(session) builds a Markdown pipe table from active players (same query/sort as /standings); style_email_table(html) injects inline styles into markdown-it's table output.
    • app/mailer.py: custom_email_body does the token substitution — it renders the standings fragment in isolation and styles it before the outer email template wraps everything in layout tables, so the styler never touches the presentation tables. send_custom_email forwards the pre-built markdown.
    • Preview (v2.py) and background send (send_admin_email.py) each build the standings lazily — only when a message uses the token — so a token-free batch never depends on a current week existing (which would raise between seasons).

    Testing

    • tests/test_mailer.py: token present → styled <table>/<th>; token absent → body unchanged.
    • flake8 clean, pylint 10.00/10.
    • Note: the 7 test_admin_email_routes.py failures are pre-existing on main, unrelated to this change.

    resolves #233

    Issues closed

    • #233 Create a form page for sending out the standings
    • #178 Have body of standings email be 'proper' HTML body of real standings

    Pull request: #483

    Downloads