refac/security: python code format endpoint

This commit is contained in:
Timothy Jaeryang Baek committed 2025-06-08 20:26:07 +04:00
1 parent 87e5aee106
commit 4fe45d4430
3 files changed
+77 -4

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ class CodeForm(BaseModel):
@router.post("/code/format")
async def format_code(form_data: CodeForm, user=Depends(get_verified_user)):
async def format_code(form_data: CodeForm, user=Depends(get_admin_user)):
try:
formatted_code = black.format_str(form_data.code, mode=black.Mode())
return {"code": formatted_code}