change: status as json instead of string
Some checks failed
ci / docker (push) Failing after 4s

This commit is contained in:
2024-11-14 22:02:00 +01:00
parent acf88ffa6e
commit df1dfd8b0c

View File

@@ -187,10 +187,11 @@ def downtime():
elif flask.request.method == "GET":
dt = app.config["DOWNTIME"]
if dt < datetime.datetime.now():
return ("No Downtime set at the moment", 200)
return flask.jsonify({"title" : "No Downtime set at the moment", "message" : ""})
else:
delta = int((dt - datetime.datetime.now()).total_seconds()/60)
return ("Downtime set for {}m until {}".format(delta, dt.isoformat()))
return flask.jsonify({"title" : "Downtime set for {}m until {}".format(delta, dt.isoformat()),
"message" : ""})
@app.route('/settings', methods=["GET", "POST"])