diff --git a/aurora/importers/aurora.py b/aurora/importers/aurora.py index f34a7b3..011cafb 100644 --- a/aurora/importers/aurora.py +++ b/aurora/importers/aurora.py @@ -63,9 +63,10 @@ class ImportAuroraView(ui.View): if "changes" not in case or not case["changes"]: changes = [] else: - changes = json.loads(case["changes"]) - if isinstance(changes, str): - changes: list[dict] = json.loads(changes) + if not isinstance(case["changes"], list): + changes = json.loads(case["changes"]) + if isinstance(changes, str): + changes: list[dict] = json.loads(changes) for change in changes: if change.get("bot"): @@ -74,7 +75,10 @@ class ImportAuroraView(ui.View): if "metadata" not in case: metadata = {} else: - metadata: Dict[str, any] = json.loads(case["metadata"]) + if isinstance(case["metadata"], str): + metadata: Dict[str, any] = json.loads(case["metadata"]) + else: + metadata = case["metadata"] if not metadata.get("imported_from"): metadata.update({"imported_from": "Aurora"}) metadata.update({"imported_timestamp": int(time())})