feature: expose the default PDF template content via the API #38

Merged
Gilles merged 1 commit from feature/pdf-template-default-content into master 2026-11-01 20:01:01 +00:00
Owner

Closes #37

Adds PdfTemplateViewSet.default_content so the frontend's template editor can offer a "reset to default" action without duplicating DEFAULT_PDF_TEMPLATE_HTML client-side -- same reasoning as poulpinou's own server-side mail_template_reset: the default lives in exactly one place.

This was originally written on the stale feature/pdf-export branch (commit 74521e48a, originally PR #19 there) before the repo switched to prod mode, and never got merged into master. Cherry-picked cleanly onto a fresh branch off current master -- the PdfTemplateViewSet/serializer/permission shape hasn't changed in a way that affects it (the new action sits between perform_update and the existing resolve action, same as before; CanManagePdfTemplate already allows any authenticated user through on GET).

Test plan

  • pytest apps/exports -- 35 passed.
  • pytest apps (full suite) -- 211 passed.
  • Full tox-equivalent check in a clean venv (pytest+coverage, pylint, autopep8 --diff --exit-code, bandit) -- all four green.

🤖 Generated with Claude Code

https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm

Closes #37 Adds `PdfTemplateViewSet.default_content` so the frontend's template editor can offer a "reset to default" action without duplicating `DEFAULT_PDF_TEMPLATE_HTML` client-side -- same reasoning as poulpinou's own server-side `mail_template_reset`: the default lives in exactly one place. This was originally written on the stale `feature/pdf-export` branch (commit `74521e48a`, originally PR #19 there) before the repo switched to prod mode, and never got merged into master. Cherry-picked cleanly onto a fresh branch off current master -- the `PdfTemplateViewSet`/serializer/permission shape hasn't changed in a way that affects it (the new action sits between `perform_update` and the existing `resolve` action, same as before; `CanManagePdfTemplate` already allows any authenticated user through on GET). ## Test plan - `pytest apps/exports` -- 35 passed. - `pytest apps` (full suite) -- 211 passed. - Full tox-equivalent check in a clean venv (pytest+coverage, pylint, autopep8 --diff --exit-code, bandit) -- all four green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm
feature: expose the default PDF template content via the API
All checks were successful
ci / test (pull_request) Successful in 3m27s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
d3c4b55321
Adds PdfTemplateViewSet.default_content so the frontend's template
editor can offer a "reset to default" action without duplicating
DEFAULT_PDF_TEMPLATE_HTML client-side -- same reasoning as poulpinou's
own server-side mail_template_reset: the default lives in exactly one
place.

Cherry-picked from the stale feature/pdf-export branch (commit
74521e48a, originally PR #19 there, never merged into master) onto a
fresh branch off master -- that branch diverged from master since
PR #20's squash-merge, so this is reapplied on current history instead
of branching off it directly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EeueXTWCT4Y6EbeideZcm
Author
Owner
<!-- argus-link-bot:thierryade/backend --> 📊 [Rapports Argus pour cette PR](https://reports.stationmyr.net/thierryade/backend/pr/38)
Gilles merged commit 141b33485f into master 2026-11-01 20:01:01 +00:00
Gilles deleted branch feature/pdf-template-default-content 2026-11-01 20:01:01 +00:00
Sign in to join this conversation.
No description provided.