diff --git a/configurator/routes/test_data_routes.py b/configurator/routes/test_data_routes.py index f6d8295..b2b619d 100644 --- a/configurator/routes/test_data_routes.py +++ b/configurator/routes/test_data_routes.py @@ -8,19 +8,7 @@ import os logger = logging.getLogger(__name__) -class TestDataJSONEncoder(json.JSONEncoder): - """Custom JSON encoder that preserves MongoDB extended JSON format for test data""" - def default(self, obj): - # For test data, we want to preserve the original format - # This encoder will be used specifically for test data responses - return super().default(obj) - - def encode(self, obj): - # Override encode to preserve MongoDB extended JSON format - if isinstance(obj, dict): - # Recursively process dictionaries to preserve $oid and $date - return super().encode(obj) - return super().encode(obj) +# Removed TestDataJSONEncoder as it's not being used and the global MongoJSONEncoder handles MongoDB objects # Define the Blueprint for test_data routes def create_test_data_routes(): diff --git a/configurator/server.py b/configurator/server.py index d9529be..e8a5a2e 100644 --- a/configurator/server.py +++ b/configurator/server.py @@ -31,7 +31,7 @@ def handle_exit(signum, frame): project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) docs_path = os.path.join(project_root, 'docs') app = Flask(__name__, static_folder=docs_path, static_url_path='/docs') -# app.json = MongoJSONEncoder(app) # Commented out to test if this causes MongoDB object conversion +app.json = MongoJSONEncoder(app) # Enable MongoDB object conversion # Auto-processing logic - runs when module is imported (including by Gunicorn) if config.AUTO_PROCESS: