Revised the retrieve_status() template tag and renamed the errors template variable to page_errors in the Mia core application.

This commit is contained in:
依瑪貓 2020-07-28 20:06:09 +08:00
parent 50c06bd3d3
commit 7ae30f9980

View File

@ -133,9 +133,12 @@ def retrieve_status(context):
return "" return ""
if "success" in status: if "success" in status:
context.dicts[0]["success"] = status["success"] context.dicts[0]["success"] = status["success"]
if "errors" in status: if "errors_by_field" in status:
if "" in status["errors"]: if "" in status["errors_by_field"]:
context.dicts[0]["errors"] = status["errors"][""] if "page_errors" not in context.dicts[0]:
context.dicts[0]["page_errors"] = []
context.dicts[0]["page_errors"].append(
status["errors_by_field"][""])
return "" return ""