From 904fd1c914882ade025b86612b969e9ccacf1d4c Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 6 May 2024 21:46:01 -0400 Subject: [PATCH] fix(aurora): fixed more import errors --- aurora/models/base.py | 6 ++---- aurora/models/moderation.py | 10 +++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/aurora/models/base.py b/aurora/models/base.py index 45c8a60..08e1cd1 100644 --- a/aurora/models/base.py +++ b/aurora/models/base.py @@ -10,8 +10,7 @@ class AuroraBaseModel(BaseModel): bot: Red def to_json(self, indent: int | None = None, file: Any | None = None, **kwargs): - from aurora.utilities.json import ( # pylint: disable=cyclic-import - dump, dumps) + from ..utilities.json import dump, dumps # pylint: disable=cyclic-import return dump(self.model_dump(exclude={"bot"}), file, indent=indent, **kwargs) if file else dumps(self.model_dump(exclude={"bot"}), indent=indent, **kwargs) class AuroraGuildModel(AuroraBaseModel): @@ -19,6 +18,5 @@ class AuroraGuildModel(AuroraBaseModel): guild_id: int def to_json(self, indent: int | None = None, file: Any | None = None, **kwargs): - from aurora.utilities.json import ( # pylint: disable=cyclic-import - dump, dumps) + from ..utilities.json import dump, dumps # pylint: disable=cyclic-import return dump(self.model_dump(exclude={"bot", "guild_id"}), file, indent=indent, **kwargs) if file else dumps(self.model_dump(exclude={"bot", "guild_id"}), indent=indent, **kwargs) diff --git a/aurora/models/moderation.py b/aurora/models/moderation.py index d63df3e..a5c6fc0 100644 --- a/aurora/models/moderation.py +++ b/aurora/models/moderation.py @@ -114,8 +114,8 @@ class Moderation(AuroraGuildModel): self.update() def update(self): - from aurora.utilities.database import connect - from aurora.utilities.json import dumps + from ..utilities.database import connect + from ..utilities.json import dumps query = f"UPDATE moderation_{self.guild_id} SET timestamp = ?, moderation_type = ?, target_type = ?, moderator_id = ?, role_id = ?, duration = ?, end_timestamp = ?, reason = ?, resolved = ?, resolved_by = ?, resolve_reason = ?, expired = ?, changes = ?, metadata = ? WHERE moderation_id = ?;" with connect() as database: @@ -199,7 +199,7 @@ class Moderation(AuroraGuildModel): @classmethod def from_sql(cls, bot: Red, moderation_id: int, guild_id: int) -> "Moderation": - from aurora.utilities.database import connect + from ..utilities.database import connect query = f"SELECT * FROM moderation_{guild_id} WHERE moderation_id = ?;" with connect() as database: @@ -234,8 +234,8 @@ class Moderation(AuroraGuildModel): changes: list | None = None, metadata: dict | None = None, ) -> "Moderation": - from aurora.utilities.database import connect - from aurora.utilities.json import dumps + from ..utilities.database import connect + from ..utilities.json import dumps if not timestamp: timestamp = datetime.fromtimestamp(time()) elif not isinstance(timestamp, datetime):