This commit is contained in:
2024-11-20 00:32:15 +01:00
parent c54c6aa9c4
commit 14ee7866b4

View File

@@ -8,8 +8,8 @@ from core.mongo import mongo_manager
class BaseRepository(abc.ABC): class BaseRepository(abc.ABC):
COLLECTION_NAME: str COLLECTION_NAME: str
@asynccontextmanager
@classmethod @classmethod
@asynccontextmanager
async def connect(cls): async def connect(cls):
async with mongo_manager.connect() as client: async with mongo_manager.connect() as client:
db = client.get_default_database() db = client.get_default_database()