From 1ec60f85bea03da80d8426db47df6fd156bd656d Mon Sep 17 00:00:00 2001 From: Jimmy Shen <14003693+jmmshn@users.noreply.github.com> Date: Sat, 12 Aug 2023 19:50:26 -0700 Subject: [PATCH] Fix `webgui` KeyError (#505) Co-authored-by: Janosh Riebesell --- fireworks/flask_site/util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fireworks/flask_site/util.py b/fireworks/flask_site/util.py index 9e778912a..1c86372ad 100644 --- a/fireworks/flask_site/util.py +++ b/fireworks/flask_site/util.py @@ -22,8 +22,7 @@ def jsonify(*args, **kwargs): """ indent = None separators = (",", ":") - - if current_app.config["JSONIFY_PRETTYPRINT_REGULAR"] or current_app.debug: + if current_app.config.get("JSONIFY_PRETTYPRINT_REGULAR") or current_app.debug: indent = 2 separators = (", ", ": ") @@ -34,5 +33,5 @@ def jsonify(*args, **kwargs): return current_app.response_class( dumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder) + "\n", - mimetype=current_app.config["JSONIFY_MIMETYPE"], + mimetype=current_app.config.get("JSONIFY_MIMETYPE"), )