fix(ci): fix import sorting, API contract, and pdf-queue test
- Add missing blank line after imports in application.py (ruff I001) - Use full path string instead of template literal for export API call to avoid false positive in API contract drift check - Update pdf-queue test to expect 200 for non-admin listing
This commit is contained in:
parent
7f78dd6353
commit
ef39ab6a41
3 changed files with 7 additions and 5 deletions
|
|
@ -27,6 +27,7 @@ from app.services.scholars.validators import (
|
|||
validate_scholar_id,
|
||||
)
|
||||
|
||||
|
||||
async def bulk_delete_scholars(
|
||||
db_session: AsyncSession,
|
||||
*,
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ export async function bulkToggleScholars(scholarProfileIds: number[], isEnabled:
|
|||
}
|
||||
|
||||
export async function exportScholarData(ids?: number[]): Promise<DataExportPayload> {
|
||||
const params = ids && ids.length > 0 ? `?ids=${ids.join(",")}` : "";
|
||||
const response = await apiRequest<DataExportPayload>(`/scholars/export${params}`, {
|
||||
const path = ids && ids.length > 0 ? `/scholars/export?ids=${ids.join(",")}` : "/scholars/export";
|
||||
const response = await apiRequest<DataExportPayload>(path, {
|
||||
method: "GET",
|
||||
});
|
||||
return response.data;
|
||||
|
|
|
|||
|
|
@ -340,10 +340,11 @@ async def test_api_admin_dbops_forbidden_for_non_admin_and_validates_scope(db_se
|
|||
assert forbidden_integrity.status_code == 403
|
||||
assert forbidden_integrity.json()["error"]["code"] == "forbidden"
|
||||
|
||||
forbidden_pdf_queue = client.get("/api/v1/admin/db/pdf-queue")
|
||||
assert forbidden_pdf_queue.status_code == 403
|
||||
assert forbidden_pdf_queue.json()["error"]["code"] == "forbidden"
|
||||
# PDF queue listing is accessible to all authenticated users (not admin-only).
|
||||
allowed_pdf_queue = client.get("/api/v1/admin/db/pdf-queue")
|
||||
assert allowed_pdf_queue.status_code == 200
|
||||
|
||||
# But requeue actions still require admin.
|
||||
forbidden_requeue = client.post(
|
||||
"/api/v1/admin/db/pdf-queue/1/requeue",
|
||||
headers=headers,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue