Repository navigation
feat(qualia): add all-forms admin endpoint - #944
augmentcode[bot] wants to merge 2 commits into
Conversation
|
👋 I've got this PR. I'll handle review feedback, CI failures, and merge conflicts, and ping you the moment it's ready for review. Drop a comment anytime. Marking it ready and picking reviewers are your call — I'll leave both alone. |
|
Provide a more detailed PR description |
|
Updated the PR description with more detail on the missing admin use case, the new |
🤖 Augment PR SummarySummary: This PR adds an admin-only endpoint to list all form cycles, including drafts and unpublished cycles. Changes:
Technical Notes: The tests stub the async DB session and patch token verification to validate access control and response serialization. 🤖 Was this summary useful? React with 👍 or 👎 |
| app.dependency_overrides.clear() | ||
|
|
||
| assert response.status_code == 403 | ||
| assert response.json() == {"detail": "Admin access required"} No newline at end of file |
There was a problem hiding this comment.
qualia/backend/tests/test_form_cycles_list_all.py: This file is missing a trailing newline at EOF (shown by the \ No newline at end of file marker in the diff), which can cause noisy diffs and some tooling/linters to fail.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
Fixed in f776f47 by adding the missing trailing newline at EOF, and re-ran qualia/backend/.venv/bin/pytest qualia/backend/tests/test_form_cycles_list_all.py successfully.
Problem
/api/v1/forms/for published forms scoped to the current user, so admins had no endpoint to inspect every form cycle, including drafts and unpublished entries.Solution
GET /api/v1/forms/allroute inqualia/backend/app/form_cycles.pythat returns all form cycles with the existing list fields, ordered consistently for backend consumers.qualia/backend/tests/test_form_cycles_list_all.pyfor both the successful admin response and the non-admin403path.Testing
qualia/backend/.venv/bin/pytest tests/test_form_cycles_list_all.py✅qualia/backend/.venv/bin/pytestshows 4 failures that are already reproducible on a cleanorigin/mainbranch and are unrelated to this change.Misc
github-app-apiwas available here, so PR attribution uses the bot surface instead of the normal manual-session GitHub tool.Pull Request opened by Augment Code | View session