fix: output downtime after reading args

This commit is contained in:
2024-11-14 23:53:24 +01:00
parent 6783426e5f
commit c10bdf1fb7

View File

@@ -347,11 +347,6 @@ def smart_send_to_clients(path=None):
- supported struct of type "ICINGA|ZABBIX|GENERIC" (see docs) in field "data"
'''
if app.config["DOWNTIME"] > datetime.datetime.now():
print("Ignoring because of Downtime:", title, message, user)
print("Downtime until", app.config["DOWNTIME"].isoformat())
return ("Ignored because of Downtime", 200)
instructions = flask.request.json
users = instructions.get("users")
@@ -360,6 +355,11 @@ def smart_send_to_clients(path=None):
title = instructions.get("title")
method = instructions.get("method")
if app.config["DOWNTIME"] > datetime.datetime.now():
print("Ignoring because of Downtime:", title, message, user)
print("Downtime until", app.config["DOWNTIME"].isoformat())
return ("Ignored because of Downtime", 200)
# authenticated by access token or webhook path #
dispatch_acces_token = flask.request.args.get("dispatch-access-token") or ""
print(path)