Compare commits

...

2 commits

Author SHA1 Message Date
64758686bb
misc(aurora): simplified AuroraGuildModel a bit
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 31s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 52s
2024-08-21 14:49:47 -04:00
fce4001152
fix(aurora): hopefully fixed changes not being imported 2024-08-21 14:48:56 -04:00
2 changed files with 1 additions and 5 deletions

View file

@ -60,7 +60,7 @@ class ImportAuroraView(ui.View):
case["target_id"] = int(case["target_id"]) case["target_id"] = int(case["target_id"])
case["moderator_id"] = int(case["moderator_id"]) case["moderator_id"] = int(case["moderator_id"])
if "changes" not in case or not case["changes"]: if not case.get("changes", None):
changes = [] changes = []
else: else:
if not isinstance(case["changes"], list): if not isinstance(case["changes"], list):

View file

@ -25,7 +25,3 @@ class AuroraGuildModel(AuroraBaseModel):
def dump(self) -> dict: def dump(self) -> dict:
return self.model_dump(exclude={"bot", "guild_id", "guild"}) return self.model_dump(exclude={"bot", "guild_id", "guild"})
def to_json(self, indent: int | None = None, file: Any | None = None, **kwargs) -> str:
from ..utilities.json import dump, dumps # pylint: disable=cyclic-import
return dump(self.dump(), file, indent=indent, **kwargs) if file else dumps(self.dump(), indent=indent, **kwargs)