@router.get( STUDENTSBULKUPDATETEMPLATE, responseclass=StreamingResponse ) def…
- User
@router.get( STUDENTS_BULK_UPDATE_TEMPLATE, response_class=StreamingResponse ) def download_bulk_upload_template( academic_id: uuid.UUID, school_id: uuid.UUID, class_id: uuid.UUID, division_id: uuid.UUID, session: SessionDep, ): """Return an .xlsx template for bulk student data upload.""" try: excel_file, school, cls, div = StudentTemplateService.generate_bulk_upload_template( session=session, academic_id=academic_id, school_id=school_id, class_id=class_id, division_id=division_id, num_rows=60, ) excel_file.seek(0) filename = f"template_{slugify(school)}{slugify(cls)}{_slugify(div)}.xlsx" return StreamingResponse( excel_file, media_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", headers={"Content-Disposition": f'attachment; filename="{filename}"'}, ) except Exception as e: return FailedAPIResponse( error=error_constants.Generic.ERROR_REQUEST, status=ApiStatus( status_code=error_constants.Generic.GENERIC_ERROR["code"], message=error_constants.Generic.GENERIC_ERROR["message"], ), detail=str(e), data=None, )
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.