From dd89e6fa9cb4e0005f5df6efc634cd4d5c3baa49 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 4 Apr 2023 12:14:05 +0200 Subject: [PATCH] Change JSONEncoder: use Python's json module instead of Flask --- app/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index f17f538c2f..0f64a7fd65 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -19,7 +19,8 @@ from flask import current_app, g, request from flask import Flask from flask import abort, flash, has_request_context, jsonify from flask import render_template -from flask.json import JSONEncoder + +# from flask.json import JSONEncoder from flask.logging import default_handler from flask_bootstrap import Bootstrap @@ -144,7 +145,7 @@ def handle_invalid_usage(error): # JSON ENCODING -class ScoDocJSONEncoder(JSONEncoder): +class ScoDocJSONEncoder(json.JSONEncoder): def default(self, o): # pylint: disable=E0202 if isinstance(o, (datetime.date, datetime.datetime)): return o.isoformat()