use return

This commit is contained in:
2025-03-09 21:44:35 +08:00
parent fa3dd701ea
commit 54b337173a
3 changed files with 10 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ def get(request, display: int):
try:
return Tutorial.objects.get(display=display)
except Tutorial.DoesNotExist:
raise HttpError(404, "此序号无教程")
return HttpError(404, "此序号无教程")
@router.post("/")
@@ -52,7 +52,7 @@ def toggle_public(request, display: int):
label = "公开" if item.is_public else "隐藏"
return {"message": f"{item.display}{item.title}{label}"}
except Tutorial.DoesNotExist:
raise HttpError(404, "此序号无教程")
return HttpError(404, "此序号无教程")
@router.delete("/{display}")