From 8d58ed909db0d363c2b690455435181747b10de3 Mon Sep 17 00:00:00 2001 From: Alex Filiov <49647025+AlexDev-py@users.noreply.github.com> Date: Sat, 14 May 2022 23:01:32 +0900 Subject: [PATCH] fix Dispatcher.release_key (#908) del bucker['key'] raises KeyError: 'key' --- aiogram/dispatcher/dispatcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py index 7abe1d8d..22f6700c 100644 --- a/aiogram/dispatcher/dispatcher.py +++ b/aiogram/dispatcher/dispatcher.py @@ -1367,7 +1367,7 @@ class Dispatcher(DataMixin, ContextInstanceMixin): bucket = await self.storage.get_bucket(chat=chat_id, user=user_id) if bucket and key in bucket: - del bucket['key'] + del bucket[key] await self.storage.set_bucket(chat=chat_id, user=user_id, bucket=bucket) return True return False