WIP: Refactor Aurora (3.0.0) #29

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

View file

@ -72,11 +72,15 @@ class ImportAuroraView(ui.View):
case["moderator_id"] = int(case["moderator_id"]) case["moderator_id"] = int(case["moderator_id"])
if "changes" not in case or not case["changes"]: if "changes" not in case or not case["changes"]:
case["changes"] = [] changes = []
else: else:
case["changes"] = json.loads(case["changes"]) changes = json.loads(case["changes"])
if isinstance(case["changes"], str): if isinstance(changes, str):
case["changes"] = json.loads(case["changes"]) changes: list[dict] = json.loads(changes)
for change in changes:
if change.get("bot"):
del change["bot"]
if "metadata" not in case: if "metadata" not in case:
metadata = {} metadata = {}
@ -107,7 +111,7 @@ class ImportAuroraView(ui.View):
resolved_by=case["resolved_by"], resolved_by=case["resolved_by"],
resolved_reason=case["resolve_reason"], resolved_reason=case["resolve_reason"],
expired=case["expired"], expired=case["expired"],
changes=case["changes"], changes=changes,
metadata=metadata, metadata=metadata,
database=database, database=database,
) )