mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix protected namespace warning for model_custom_emoji_id (#1775)
* fix UserWarning, model_custom_emoji_id * Add changelog for #1772
This commit is contained in:
parent
f68c24d620
commit
bd75ae361e
2 changed files with 3 additions and 2 deletions
1
CHANGES/1772.bugfix.rst
Normal file
1
CHANGES/1772.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed Pydantic protected namespace warning for `model_custom_emoji_id` by adding `protected_namespaces=()` to `model_config`.
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
from typing import Any
|
||||
from unittest.mock import sentinel
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, model_validator
|
||||
|
||||
from aiogram.client.context_controller import BotContextController
|
||||
from aiogram.client.default import Default
|
||||
from pydantic import BaseModel, ConfigDict, model_validator
|
||||
|
||||
|
||||
class TelegramObject(BotContextController, BaseModel):
|
||||
|
|
@ -16,6 +15,7 @@ class TelegramObject(BotContextController, BaseModel):
|
|||
populate_by_name=True,
|
||||
arbitrary_types_allowed=True,
|
||||
defer_build=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@model_validator(mode="before")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue