From e79ab53dce0f1a7e8095cc926a62c7c86598cf70 Mon Sep 17 00:00:00 2001 From: RootShinobi <111008396+RootShinobi@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:20:22 +0200 Subject: [PATCH] Fixed the order of handlers in the Scene --- CHANGES/1609.misc.rst | 1 + aiogram/fsm/scene.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 CHANGES/1609.misc.rst diff --git a/CHANGES/1609.misc.rst b/CHANGES/1609.misc.rst new file mode 100644 index 00000000..464f4b7e --- /dev/null +++ b/CHANGES/1609.misc.rst @@ -0,0 +1 @@ +Fixed the order of handlers in the :class:`aiogram.fsm.scene.Scene` diff --git a/aiogram/fsm/scene.py b/aiogram/fsm/scene.py index 0cbd0e8b..2cb85736 100644 --- a/aiogram/fsm/scene.py +++ b/aiogram/fsm/scene.py @@ -323,7 +323,8 @@ class Scene: if callback_query_without_state is None: callback_query_without_state = parent_scene_config.callback_query_without_state - for name, value in inspect.getmembers(cls): + for name in vars(cls): + value = getattr(cls, name) if scene_handlers := getattr(value, "__aiogram_handler__", None): handlers.extend(scene_handlers) if isinstance(value, ObserverDecorator):