From 2f48e6c86ec96a7f3969dd38cea12503cd07a0d0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 22:06:29 +0200 Subject: [PATCH] fd --- drama/routes/posts.py | 2 +- drama/routes/users.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drama/routes/posts.py b/drama/routes/posts.py index b349eef96..e1623d8bf 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -23,7 +23,7 @@ with open("snappy.txt", "r") as f: snappyquotes = f.read().split("{[para]}") @app.route("/resize") -def resize() +def resize(): u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first() print(u.username) print(f"1 {u.profileurl}") diff --git a/drama/routes/users.py b/drama/routes/users.py index 314504aa0..fda3a9196 100644 --- a/drama/routes/users.py +++ b/drama/routes/users.py @@ -20,10 +20,11 @@ beams_client = PushNotifications( ) @app.route("/@/suicide") +@limiter.limit("1/hour") @auth_required def suicide(v, username): - t = int(time()) - if t - v.suicide_utc < 86400: abort(403) + #t = int(time()) + #if t - v.suicide_utc < 86400: abort(403) user = get_user(username) suicide = f"""Hi there, @@ -44,8 +45,8 @@ def suicide(v, username): Your fellow dramatards care about you and there are people who want to help.""" send_notification(1046, user, suicide) - v.suicide_utc = t - g.db.add(v) + #v.suicide_utc = t + #g.db.add(v) return "", 204 @app.route("/api/v1/user/", methods=["GET"])