diff options
Diffstat (limited to 'handlers/config.py')
| -rw-r--r-- | handlers/config.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/handlers/config.py b/handlers/config.py index 21d556b..7628805 100644 --- a/handlers/config.py +++ b/handlers/config.py | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | from json import JSONDecodeError, dumps, loads | 1 | from json import JSONDecodeError, dumps, loads |
| 2 | from logging import info | ||
| 2 | 3 | ||
| 3 | from aiogram import types as t | 4 | from aiogram import types as t |
| 4 | from pydantic import BaseModel, ValidationError | 5 | from pydantic import BaseModel, ValidationError |
| @@ -42,7 +43,7 @@ async def settings_command(msg: t.Message) -> None: | |||
| 42 | text = "" | 43 | text = "" |
| 43 | for field_name in path: | 44 | for field_name in path: |
| 44 | assert ( | 45 | assert ( |
| 45 | isinstance(config, BaseModel) and f in config.__fields__ | 46 | isinstance(config, BaseModel) and field_name in config.__fields__ |
| 46 | ), "Параметр не найден" | 47 | ), "Параметр не найден" |
| 47 | field_info = config.__fields__[field_name].field_info | 48 | field_info = config.__fields__[field_name].field_info |
| 48 | config = getattr(config, field_name) | 49 | config = getattr(config, field_name) |
