Apply suggestion from @Copilot

raise exception rather than return it and fix var name switch up

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Maximilian Dorninger
2025-10-30 16:25:44 +01:00
committed by GitHub
parent 079ac1b130
commit 855385b097

View File

@@ -77,8 +77,8 @@ def update_torrent_status(
torrent.imported = imported
if state is not None:
torrent.status = state
if status is None and imported is None:
return HTTPException(
if state is None and imported is None:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="No status or imported value provided",
)