fix(aurora): fixed a bug in the Aurora importer that prevented new imports from being imported
Some checks failed
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 4s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 29s

This commit is contained in:
Seaswimmer 2024-08-21 14:15:25 -04:00
parent 797793b970
commit 8479dcdd48
Signed by: cswimr
GPG key ID: 3813315477F26F82

View file

@ -63,6 +63,7 @@ class ImportAuroraView(ui.View):
if "changes" not in case or not case["changes"]:
changes = []
else:
if not isinstance(case["changes"], list):
changes = json.loads(case["changes"])
if isinstance(changes, str):
changes: list[dict] = json.loads(changes)
@ -74,7 +75,10 @@ class ImportAuroraView(ui.View):
if "metadata" not in case:
metadata = {}
else:
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())})