Skip to content

Commit

Permalink
fix(server): use make_response explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitMY committed Jul 2, 2024
1 parent 2242be5 commit b471b81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions signwriting/fingerspelling/server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from flask import make_response, jsonify
from flask_restful import Resource, reqparse

from signwriting.fingerspelling.fingerspelling import spell, get_chars_by
Expand All @@ -14,6 +15,7 @@ def get(self):
try:
chars = get_chars_by(value=args["signed_language"], category="SIGNED")
except ValueError as e:
return {"message": str(e)}, 400
return make_response(jsonify({"message": str(e)}), 400)

return {"fsw": spell(args["text"], chars=chars)}
fsw = spell(args["text"], chars=chars)
return make_response(jsonify({"fsw": fsw}), 200)
4 changes: 3 additions & 1 deletion signwriting/mouthing/server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from flask import make_response, jsonify
from flask_restful import Resource, reqparse

from signwriting.mouthing.mouthing import mouth
Expand All @@ -12,4 +13,5 @@ class Mouthing(Resource):
def get(self):
args = parser.parse_args()

return {"fsw": mouth(args["text"], language=args["spoken_language"])}
fsw = mouth(args["text"], language=args["spoken_language"])
return make_response(jsonify({"fsw": fsw}), 200)

0 comments on commit b471b81

Please sign in to comment.