mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-10 18:30:22 +01:00
Fix random handlers
This commit is contained in:
@@ -43,6 +43,9 @@ async def get_random_author(
|
||||
{"allowed_langs": allowed_langs}, request.app.state.redis
|
||||
)
|
||||
|
||||
if author_id is None:
|
||||
raise HTTPException(status.HTTP_204_NO_CONTENT)
|
||||
|
||||
return (
|
||||
await AuthorDB.objects.select_related(SELECT_RELATED_FIELDS)
|
||||
.prefetch_related(PREFETCH_RELATED_FIELDS)
|
||||
|
||||
Reference in New Issue
Block a user