From 825ae55dbf843535b19b546b264aafa4f0fcea97 Mon Sep 17 00:00:00 2001 From: ziro Date: Sat, 12 Aug 2023 11:39:31 +0700 Subject: [PATCH] fix: Caselog should get latest case id --- src/zibot/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zibot/utils/__init__.py b/src/zibot/utils/__init__.py index bcf2bb8..31b9008 100644 --- a/src/zibot/utils/__init__.py +++ b/src/zibot/utils/__init__.py @@ -301,7 +301,7 @@ async def doCaselog( ) -> Optional[int]: # I had to use .values() instead of .first() because of a known Tortoise issue # REF: https://github.com/tortoise/tortoise-orm/issues/794 - q: list[dict[str, Any]] = await db.CaseLog.filter(guild_id=guildId).annotate(caseNum=Max("caseId")).values("caseId") # type: ignore + q: list[dict[str, Any]] = await db.CaseLog.filter(guild_id=guildId).annotate(caseId=Max("caseId")).values("caseId") # type: ignore try: caseNum = q[0]["caseId"]