notify: remove a lot of leaky print statements

This commit is contained in:
eyjhb 2025-03-10 13:12:11 +01:00
parent 2df7038142
commit b067fb5df2
Signed by: eyjhb
GPG key ID: 609F508E3239F920

View file

@ -93,7 +93,6 @@ def index():
# handle post stuff
if request.method == "POST":
action = request.form.get("action", "").lower()
print("Action", action)
if "token" in action:
generate_token_for_user(username)
elif "room id" in action:
@ -179,7 +178,6 @@ def send_notification():
body = request.args.get("body", request.get_data().decode("utf-8"))
if not body:
body = " "
print("BODY", body)
token = request.authorization.token or request.authorization.password
if not token:
return (
@ -199,7 +197,6 @@ def send_notification():
con = get_db()
cur = con.cursor()
print(token)
res = cur.execute(
"SELECT username FROM tokens WHERE token = ?", (token,)
).fetchone()
@ -212,8 +209,6 @@ def send_notification():
if ntype not in ["matrix", "mail"]:
return ("Invalid type, only matrix or mail allowed", 400)
print(ntype, username, token)
apobj = apprise.Apprise()
if ntype == "matrix":
# try to get a room_id
@ -225,8 +220,6 @@ def send_notification():
if res:
room_id = res[0]
print(room_id)
if not room_id:
return ("No room_id specified, and no default saved", 400)