misc(aurora): allow Moderation.log() to skip returning the class object
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 29s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 44s

This commit is contained in:
Seaswimmer 2024-06-04 16:35:18 -04:00
parent 720e100a20
commit b252343dc0
Signed by: 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"],
) )
return cls.find_by_id(bot=bot, moderation_id=moderation_id, guild_id=guild_id) if return_obj:
return cls.find_by_id(bot=bot, moderation_id=moderation_id, guild_id=guild_id)