use return

This commit is contained in:
xuyue committed 2025-03-09 21:44:35 +08:00
1 parent fa3dd701ea
commit 54b337173a
3 files changed
+10 -9

No files matched your search

+2 -2
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}")