WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
Showing only changes of commit 8479dcdd48 - Show all commits

View file

@ -63,6 +63,7 @@ class ImportAuroraView(ui.View):
if "changes" not in case or not case["changes"]: if "changes" not in case or not case["changes"]:
changes = [] changes = []
else: else:
if not isinstance(case["changes"], list):
changes = json.loads(case["changes"]) changes = json.loads(case["changes"])
if isinstance(changes, str): if isinstance(changes, str):
changes: list[dict] = json.loads(changes) changes: list[dict] = json.loads(changes)
@ -74,7 +75,10 @@ class ImportAuroraView(ui.View):
if "metadata" not in case: if "metadata" not in case:
metadata = {} metadata = {}
else: else:
if isinstance(case["metadata"], str):
metadata: Dict[str, any] = json.loads(case["metadata"]) metadata: Dict[str, any] = json.loads(case["metadata"])
else:
metadata = case["metadata"]
if not metadata.get("imported_from"): if not metadata.get("imported_from"):
metadata.update({"imported_from": "Aurora"}) metadata.update({"imported_from": "Aurora"})
metadata.update({"imported_timestamp": int(time())}) metadata.update({"imported_timestamp": int(time())})