fix(aurora): fixed another OperationalError
This commit is contained in:
parent
f3246366ff
commit
cb424ed722
1 changed files with 2 additions and 2 deletions
|
@ -314,7 +314,7 @@ class Moderation(AuroraGuildModel):
|
||||||
@classmethod
|
@classmethod
|
||||||
async def get_latest(cls, bot: Red, guild_id: int, before: datetime = None, after: datetime = None, limit: int | None = None, offset: int = 0, types: Iterable[Type] | None = None, cursor: Cursor | None = None) -> Tuple["Moderation"]:
|
async def get_latest(cls, bot: Red, guild_id: int, before: datetime = None, after: datetime = None, limit: int | None = None, offset: int = 0, types: Iterable[Type] | None = None, cursor: Cursor | None = None) -> Tuple["Moderation"]:
|
||||||
params = []
|
params = []
|
||||||
query = f"SELECT * FROM moderation_{guild_id} ORDER BY moderation_id DESC"
|
query = f"SELECT * FROM moderation_{guild_id}"
|
||||||
conditions = []
|
conditions = []
|
||||||
|
|
||||||
if types:
|
if types:
|
||||||
|
@ -334,7 +334,7 @@ class Moderation(AuroraGuildModel):
|
||||||
if limit:
|
if limit:
|
||||||
query += " LIMIT ? OFFSET ?"
|
query += " LIMIT ? OFFSET ?"
|
||||||
params.extend((limit, offset))
|
params.extend((limit, offset))
|
||||||
query += ";"
|
query += " ORDER BY moderation_id DESC;"
|
||||||
return await cls.execute(bot=bot, guild_id=guild_id, query=query, parameters=tuple(params) if params else (), cursor=cursor)
|
return await cls.execute(bot=bot, guild_id=guild_id, query=query, parameters=tuple(params) if params else (), cursor=cursor)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue