fix(aurora): fixed a pydantic error

This commit is contained in:
Seaswimmer 2024-05-04 18:07:29 -04:00
parent b752181781
commit 1313834ea5
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F
2 changed files with 2 additions and 2 deletions

View file

@ -101,7 +101,7 @@ class Change(AuroraBaseModel):
return await PartialUser.from_id(self.bot, self.user_id) return await PartialUser.from_id(self.bot, self.user_id)
@classmethod @classmethod
def from_dict(cls, bot: Red, data: dict) -> "Change": def from_dict(cls, bot: Red, guild_id: int, data: dict) -> "Change":
return cls(bot=bot, **data) return cls(bot=bot, **data)
class PartialUser(AuroraBaseModel): class PartialUser(AuroraBaseModel):

View file

@ -137,7 +137,7 @@ def generate_dict(bot: Red, result: dict, guild_id: int) -> dict:
changes = json.loads(result[14].strip('"').replace('\\"', '"')) changes = json.loads(result[14].strip('"').replace('\\"', '"'))
change_obj_list = [] change_obj_list = []
for change in changes: for change in changes:
change_obj_list.append(Change.from_dict(bot=bot, data=change)) change_obj_list.append(Change.from_dict(bot=bot, guild_id=guild_id, data=change))
case = { case = {
"moderation_id": int(result[0]), "moderation_id": int(result[0]),