mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Refactoring while review
This commit is contained in:
parent
13bd7f2b98
commit
90b55e39dd
1 changed files with 2 additions and 2 deletions
|
|
@ -86,9 +86,9 @@ class MongoStorage(BaseStorage):
|
|||
async def get_state(self, key: StorageKey) -> Optional[str]:
|
||||
document_id = self._key_builder.build(key)
|
||||
document = await self._collection.find_one({"_id": document_id})
|
||||
if document is None or document.get("state") is None:
|
||||
if document is None:
|
||||
return None
|
||||
return str(document["state"])
|
||||
return document.get("state")
|
||||
|
||||
async def set_data(self, key: StorageKey, data: Dict[str, Any]) -> None:
|
||||
document_id = self._key_builder.build(key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue