From 4d2004ed93ea585239e2fe8de77480dfc4d43940 Mon Sep 17 00:00:00 2001 From: cswimr Date: Wed, 21 Aug 2024 15:16:10 -0400 Subject: [PATCH] fix(aurora): fix changes not being imported --- aurora/importers/aurora.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aurora/importers/aurora.py b/aurora/importers/aurora.py index caff53c..9e4fdc2 100644 --- a/aurora/importers/aurora.py +++ b/aurora/importers/aurora.py @@ -60,16 +60,17 @@ class ImportAuroraView(ui.View): case["target_id"] = int(case["target_id"]) case["moderator_id"] = int(case["moderator_id"]) - if not case.get("changes", None): + changes = case.get("changes", None) + if not changes: changes = [] else: - if not isinstance(case["changes"], list): - changes = json.loads(case["changes"]) + if not isinstance(changes, list): + changes = json.loads(changes) if isinstance(changes, str): changes: list[dict] = json.loads(changes) for change in changes: - if change.get("bot"): + if "bot" in change: del change["bot"] if "metadata" not in case: