🔧 修复 admin 数据库读写引发的错误

This commit is contained in:
洛水居室 2022-08-06 14:38:09 +08:00
parent 9c208f7b4c
commit ae7cd186bd
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -22,7 +22,8 @@ class BotAdminRepository:
async def add_by_user_id(self, user_id: int): async def add_by_user_id(self, user_id: int):
async with self.mysql.Session() as session: async with self.mysql.Session() as session:
admin = Admin(user_id=user_id) admin = Admin(user_id=user_id)
await session.add(admin) session.add(admin)
await session.commit()
async def get_all_user_id(self) -> List[int]: async def get_all_user_id(self) -> List[int]:
async with self.mysql.Session() as session: async with self.mysql.Session() as session: