misc(aurora): allow Moderation.log() to skip returning the class object

This commit is contained in:
Seaswimmer 2024-06-04 16:35:18 -04:00
parent 720e100a20
commit b252343dc0
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F
2 changed files with 5 additions and 2 deletions

View file

@ -114,6 +114,7 @@ class ImportAuroraView(ui.View):
changes=changes, changes=changes,
metadata=metadata, metadata=metadata,
database=database, database=database,
return_obj=False
) )
await interaction.edit_original_response(content="Import complete.") await interaction.edit_original_response(content="Import complete.")

View file

@ -298,7 +298,8 @@ class Moderation(AuroraGuildModel):
expired: bool | None = None, expired: bool | None = None,
changes: list | None = None, changes: list | None = None,
metadata: dict | None = None, metadata: dict | None = None,
) -> "Moderation": return_obj: bool = True,
) -> "Moderation" | None:
from ..utilities.database import connect from ..utilities.database import connect
from ..utilities.json import dumps from ..utilities.json import dumps
if not timestamp: if not timestamp:
@ -390,4 +391,5 @@ class Moderation(AuroraGuildModel):
case["metadata"], case["metadata"],
) )
if return_obj:
return cls.find_by_id(bot=bot, moderation_id=moderation_id, guild_id=guild_id) return cls.find_by_id(bot=bot, moderation_id=moderation_id, guild_id=guild_id)