Skip to content

Commit

Permalink
fix: Caselog (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Aug 12, 2023
1 parent 2d1a395 commit b53da38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zibot/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ 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() # type: ignore
q: list[dict[str, Any]] = await db.CaseLog.filter(guild_id=guildId).annotate(caseNum=Max("caseId")).values("caseId") # type: ignore

try:
caseNum = q[0]["caseNum"]
caseNum = q[0]["caseId"]
except (IndexError, KeyError):
caseNum = 0
caseNum += 1
Expand Down

0 comments on commit b53da38

Please sign in to comment.