fix(aurora): get_next_case_number now only retrieves the first entry in the sql database (using LIMIT 1)

This commit is contained in:
Seaswimmer 2024-06-04 16:37:28 -04:00
parent b252343dc0
commit 3fdc54b7cb
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -249,7 +249,7 @@ class Moderation(AuroraGuildModel):
@classmethod
def get_next_case_number(cls, bot: Red, guild_id: int, cursor: Cursor | None = None) -> int:
result = cls.get_latest(bot=bot, guild_id=guild_id, cursor=cursor)
result = cls.get_latest(bot=bot, guild_id=guild_id, cursor=cursor, limit=1)
return (result[0].moderation_id + 1) if result else 1
@classmethod