mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Fix random handlers
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from fastapi import APIRouter, Depends, Request
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, status
|
||||
|
||||
from fastapi_pagination import Params
|
||||
from fastapi_pagination.ext.ormar import paginate
|
||||
@@ -34,6 +34,9 @@ async def get_random_sequence(
|
||||
request.app.state.redis,
|
||||
)
|
||||
|
||||
if sequence_id is None:
|
||||
raise HTTPException(status.HTTP_204_NO_CONTENT)
|
||||
|
||||
return await SequenceDB.objects.get(id=sequence_id)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user