Have OctoPrintJsonEncoder fall back to flask encoder

That supports some types we want to keep just in case.
This commit is contained in:
Gina Häußge committed 2018-03-20 16:19:06 +01:00
1 parent e4914b8bd3
commit 0224037478
1 file changed
+4 -1
+4 -1
View File
@@ -1422,4 +1422,7 @@ def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
class OctoPrintJsonEncoder(flask.json.JSONEncoder):
def default(self, obj):
return JsonEncoding.encode(obj)
try:
return JsonEncoding.encode(obj)
except TypeError:
return flask.json.JSONEncoder.default(self, obj)