mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Split up return statements in get_value functions
This commit is contained in:
parent
8fc682b3f4
commit
e5f1d5be60
3 changed files with 6 additions and 3 deletions
|
|
@ -59,7 +59,8 @@ class MemoryStorage(BaseStorage):
|
|||
async def get_value(
|
||||
self, storage_key: StorageKey, dict_key: str, default: Optional[Any] = None
|
||||
) -> Optional[Any]:
|
||||
return copy(self.storage[storage_key].data.get(dict_key, default))
|
||||
data = self.storage[storage_key].data
|
||||
return copy(data.get(dict_key, default))
|
||||
|
||||
|
||||
class DisabledEventIsolation(BaseEventIsolation):
|
||||
|
|
|
|||
|
|
@ -124,7 +124,8 @@ class MongoStorage(BaseStorage):
|
|||
async def get_value(
|
||||
self, storage_key: StorageKey, dict_key: str, default: Optional[Any] = None
|
||||
) -> Optional[Any]:
|
||||
return (await self.get_data(storage_key)).get(dict_key, default)
|
||||
data = await self.get_data(storage_key)
|
||||
return data.get(dict_key, default)
|
||||
|
||||
async def update_data(self, key: StorageKey, data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
document_id = self._key_builder.build(key)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ class RedisStorage(BaseStorage):
|
|||
async def get_value(
|
||||
self, storage_key: StorageKey, dict_key: str, default: Optional[Any] = None
|
||||
) -> Optional[Any]:
|
||||
return (await self.get_data(storage_key)).get(dict_key, default)
|
||||
data = await self.get_data(storage_key)
|
||||
return data.get(dict_key, default)
|
||||
|
||||
|
||||
class RedisEventIsolation(BaseEventIsolation):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue