Skip to content

Commit

Permalink
Added Flask config for custom JSON encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
jtc42 committed Jun 23, 2020
1 parent 7ad7b1b commit 395ffb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/labthings/server/representations.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def output_json(data, code, headers=None):
"""Makes a Flask response with a JSON encoded body, using app JSON settings"""

settings = current_app.config.get("LABTHINGS_JSON", {})
encoder = LabThingsJSONEncoder
encoder = current_app.config.get("LABTHINGS_JSON_ENCODER", {}) or LabThingsJSONEncoder

if current_app.debug:
settings.setdefault("indent", 4)
Expand Down

0 comments on commit 395ffb6

Please sign in to comment.