WIP: Refactor Aurora (3.0.0) #29
1 changed files with 5 additions and 4 deletions
|
@ -60,16 +60,17 @@ class ImportAuroraView(ui.View):
|
||||||
case["target_id"] = int(case["target_id"])
|
case["target_id"] = int(case["target_id"])
|
||||||
case["moderator_id"] = int(case["moderator_id"])
|
case["moderator_id"] = int(case["moderator_id"])
|
||||||
|
|
||||||
if not case.get("changes", None):
|
changes = case.get("changes", None)
|
||||||
|
if not changes:
|
||||||
changes = []
|
changes = []
|
||||||
else:
|
else:
|
||||||
if not isinstance(case["changes"], list):
|
if not isinstance(changes, list):
|
||||||
changes = json.loads(case["changes"])
|
changes = json.loads(changes)
|
||||||
if isinstance(changes, str):
|
if isinstance(changes, str):
|
||||||
changes: list[dict] = json.loads(changes)
|
changes: list[dict] = json.loads(changes)
|
||||||
|
|
||||||
for change in changes:
|
for change in changes:
|
||||||
if change.get("bot"):
|
if "bot" in change:
|
||||||
del change["bot"]
|
del change["bot"]
|
||||||
|
|
||||||
if "metadata" not in case:
|
if "metadata" not in case:
|
||||||
|
|
Loading…
Reference in a new issue