From 8109b467ec9cefdc8c0672837a9700589462631e Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Sun, 1 Jan 2023 21:43:55 +0100 Subject: [PATCH] Fix --- src/app/services/cache_updater.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/services/cache_updater.py b/src/app/services/cache_updater.py index ee288d3..a14cbe3 100644 --- a/src/app/services/cache_updater.py +++ b/src/app/services/cache_updater.py @@ -72,9 +72,7 @@ async def check_books(ctx: dict, *args, **kwargs) -> None: # NOSONAR ) -async def cache_file( - book: Book, file_type: str, by_request: bool = True -) -> Optional[CachedFile]: +async def cache_file(book: Book, file_type: str) -> Optional[CachedFile]: if await CachedFile.objects.filter( object_id=book.id, object_type=file_type ).exists(): @@ -108,15 +106,13 @@ async def cache_file( if upload_data is None: return None - cached_file = await CachedFile.objects.create( + return await CachedFile.objects.create( object_id=book.id, object_type=file_type, message_id=upload_data.data["message_id"], chat_id=upload_data.data["chat_id"], ) - return cached_file - async def cache_file_by_book_id( ctx: dict, # NOSONAR