From 0c3d436bbd73895ab8a9403fe31b76d7e2e5b86e Mon Sep 17 00:00:00 2001 From: "Diccion, Kaeren C (UG - Computer Science)" <kd00450@surrey.ac.uk> Date: Fri, 12 Mar 2021 13:52:08 +0000 Subject: [PATCH] Update showtimes.py --- showtimes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/showtimes.py b/showtimes.py index f4d236c..7136f94 100644 --- a/showtimes.py +++ b/showtimes.py @@ -1,4 +1,4 @@ -from services import root_dir, nice_json +#from services import root_dir, nice_json from flask import Flask from werkzeug.exceptions import NotFound import json @@ -13,7 +13,7 @@ with open("{}/database/showtimes.json".format(os.getcwd()), "r") as f: @app.route("/", methods=['GET']) def hello(): - return nice_json({ + return json.dump({ "uri": "/", "subresource_uris": { "showtimes": "/showtimes", @@ -24,7 +24,7 @@ def hello(): @app.route("/showtimes", methods=['GET']) def showtimes_list(): - nice_json(showtimes) + json.dump(showtimes) @app.route("/showtimes/<date>", methods=['GET']) @@ -32,7 +32,7 @@ def showtimes_record(date): if date not in showtimes: raise NotFound print(showtimes[date]) - return nice_json(showtimes[date]) + return json.dump(showtimes[date]) if __name__ == "__main__": app.run(port=5002, debug=True) -- GitLab