Skip to content

Stop offering the Jinja2 source type in the survey editor - #5

Merged
krlex merged 1 commit into
developfrom
fix/survey-drop-jinja2-source
Aug 19, 2026
Merged

Stop offering the Jinja2 source type in the survey editor#5
krlex merged 1 commit into
developfrom
fix/survey-drop-jinja2-source

Conversation

@krlex

@krlex krlex commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Follows the backend fix for C1 (2026-08-19 Codex review): the server no
longer accepts dynamic_choices.source_type: jinja2, because it rendered an
operator-supplied template inside the web process and any user with start
permission could trigger it.

Leaving the option in this dropdown would only produce a form that fails
validation on save, with no explanation of why.

What changed

  • jinja2 is gone from the offered source types; the editor now offers Database
    Query and External API, which is exactly what the server accepts.
  • A survey saved before the withdrawal still carries the value. It stays
    selectable in that one case, labelled "Jinja2 Template (withdrawn)", with
    the reason shown in the editor. Removing it outright would make the select
    fall back to its first option, and the question would silently read as a
    Database Query it never was.
  • A test asserts the offered list, so re-adding it is a deliberate act rather
    than an accident.

Verified

  • tsc -b clean.
  • vitest run: 20 files, 215 tests, all passing (212 before — three added here).
  • npm run build succeeds.

The backend now refuses `dynamic_choices.source_type: jinja2` -- it rendered an
operator-supplied template in the web process, which any user with `start`
permission could then trigger. Leaving it in this dropdown would only build a
form that fails validation on save.

A survey saved before the withdrawal still carries the value, so it stays
selectable in that one case, labelled as withdrawn and with the reason shown in
the editor. Dropping it outright would make the select fall back to its first
option and the question would read as a Database Query it never was.
@krlex
krlex force-pushed the fix/survey-drop-jinja2-source branch 2 times, most recently from 3d84894 to 0910513 Compare August 19, 2026 21:17
@krlex
krlex merged commit 3d67f1b into develop Aug 19, 2026
2 checks passed
@krlex
krlex deleted the fix/survey-drop-jinja2-source branch August 19, 2026 21:23
krlex added a commit that referenced this pull request Aug 19, 2026
`build/` was never in .gitignore — `dist/` is there, but vite.config.ts sets
`outDir: build/forail`. Nothing had ever committed it until a `git add -A` after
a local `npm run build` swept it in, and merging that PR put ten generated
assets plus the tsc incremental state into develop.

They are pure noise there. The Dockerfile is multi-stage and runs `npm run build`
in the builder stage, so the committed copy is never the one that ships. What it
does produce is conflicts: any two branches that each ran a build disagree on
files nobody edited, which is exactly what happened between #5 and #6.

Removed from the index and ignored, along with `*.tsbuildinfo` and the
`vite.config.d.ts` that `tsc -b` emits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant