fix(aurora): troubleshooting this annoying json issue
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 30s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 49s

This commit is contained in:
Seaswimmer 2024-05-04 22:57:34 -04:00
parent 293f77c228
commit de90f6a8b7
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -135,8 +135,9 @@ def generate_dict(bot: Red, result: dict, guild_id: int) -> dict:
duration = None duration = None
if result[14] is not None: if result[14] is not None:
logger.debug('%s\n%s', result[14], result[14].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')) json_str = f'{result[14].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')}'
changes = json.loads(result[14].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')) logger.debug('%s\n%s', result[14], json_str)
changes = json.loads(json_str)
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, data=change))