mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Fix validation error for empty files in request
This commit is contained in:
parent
5413cf4367
commit
2d6a9e4ff7
1 changed files with 2 additions and 0 deletions
|
|
@ -54,6 +54,8 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[T]):
|
|||
return Response[self.__returning__](**data) # type: ignore
|
||||
|
||||
def prepare_file(self, name: str, value: Any, data: Dict[str, Any], files: Dict[str, Any]):
|
||||
if not value:
|
||||
return
|
||||
if name == "thumb":
|
||||
tag = secrets.token_urlsafe(10)
|
||||
files[tag] = value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue