pdf-quiz-generator/backend
Daniel 18fa1913a4 fix: the contact form's messages were readable by anyone
`GET /api/contact/submissions` had no authentication. `require_admin` was
imported inside the function body and never used as a dependency, so the import
read as protection and was none: anyone who guessed the path could read every
sender's name, email address and message. `PUT .../read` was open the same way.

Both now depend on `require_admin`, with a test that a learner gets 403 and an
administrator gets the list. A row with a null timestamp no longer takes the
whole listing down with it — which is the only reason the hole showed up as a
500 rather than as data.

Also: the tutor's site switch lives in Redis, which the tests share with the
running site, so turning the tutor off in the interface turned a test red. The
test now sets the flag it depends on and puts it back.

And the tutor button is hidden until the server says it is allowed, rather than
shown and then withdrawn — on a site with it switched off that flicker reads as
a bug rather than a policy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
2026-09-12 22:37:28 +02:00
..
alembic feat: cards remember, render as prose, and are reachable from a question 2026-09-12 21:50:31 +02:00
app fix: the contact form's messages were readable by anyone 2026-09-12 22:37:28 +02:00
scripts content: every article has a high-yield view, and three ties that were not ties 2026-09-12 18:16:59 +02:00
tests fix: the contact form's messages were readable by anyone 2026-09-12 22:37:28 +02:00
.dockerignore Initial commit: PDF Quiz Generator app 2026-03-30 20:04:53 +00:00
.env.example fix: thumbnails may be kept, the embedding model may not be changed here 2026-09-12 21:35:26 +02:00
alembic.ini Wire Alembic to live Postgres and fix startup DDL race 2026-04-14 04:49:23 +02:00
Dockerfile Initial commit: PDF Quiz Generator app 2026-03-30 20:04:53 +00:00
manage.py Cross-browser job tracking, hamburger fix, CLI extract, quiz delete keeps bank questions 2026-04-01 02:30:47 +02:00
requirements.txt fix: WebP figures, the openai SDK removed, and a voice a site can add to 2026-09-12 17:13:05 +02:00