fix(aurora): fixed a bug in the Aurora importer that prevented new imports from being imported
This commit is contained in:
parent
797793b970
commit
8479dcdd48
1 changed files with 8 additions and 4 deletions
|
@ -63,9 +63,10 @@ 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:
|
||||||
changes = json.loads(case["changes"])
|
if not isinstance(case["changes"], list):
|
||||||
if isinstance(changes, str):
|
changes = json.loads(case["changes"])
|
||||||
changes: list[dict] = json.loads(changes)
|
if isinstance(changes, str):
|
||||||
|
changes: list[dict] = json.loads(changes)
|
||||||
|
|
||||||
for change in changes:
|
for change in changes:
|
||||||
if change.get("bot"):
|
if change.get("bot"):
|
||||||
|
@ -74,7 +75,10 @@ class ImportAuroraView(ui.View):
|
||||||
if "metadata" not in case:
|
if "metadata" not in case:
|
||||||
metadata = {}
|
metadata = {}
|
||||||
else:
|
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"):
|
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())})
|
||||||
|
|
Loading…
Reference in a new issue