fix(aurora): fixed a logging statement

This commit is contained in:
Seaswimmer 2024-05-06 15:11:11 -04:00
parent 5be5a39c54
commit 16af26f93e
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -1,3 +1,4 @@
import json
import sqlite3 import sqlite3
from datetime import datetime, timedelta from datetime import datetime, timedelta
from time import time from time import time
@ -106,7 +107,7 @@ class Moderation(AuroraGuildModel):
)) ))
cursor.close() cursor.close()
logger.info("Row updated in moderation_%s!\n%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s", logger.debug("Row updated in moderation_%s!\n%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s",
self.moderation_id, self.moderation_id,
self.guild_id, self.guild_id,
self.timestamp.timestamp(), self.timestamp.timestamp(),
@ -278,6 +279,9 @@ class Change(AuroraBaseModel):
@classmethod @classmethod
def from_dict(cls, bot: Red, data: dict) -> "Change": def from_dict(cls, bot: Red, data: dict) -> "Change":
logger.debug("Creating Change from dict (%s): %s", type(data), data) logger.debug("Creating Change from dict (%s): %s", type(data), data)
if isinstance(data, str):
data = json.loads(data)
logger.debug("Change data was a string, converted to dict: %s", data)
if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta): if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta):
hours, minutes, seconds = map(int, data["duration"].split(':')) hours, minutes, seconds = map(int, data["duration"].split(':'))
duration = timedelta(hours=hours, minutes=minutes, seconds=seconds) duration = timedelta(hours=hours, minutes=minutes, seconds=seconds)