forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-07-24 22:06:29 +02:00
parent 13c03ef01f
commit 2f48e6c86e
2 changed files with 6 additions and 5 deletions

View File

@ -23,7 +23,7 @@ with open("snappy.txt", "r") as f:
snappyquotes = f.read().split("{[para]}") snappyquotes = f.read().split("{[para]}")
@app.route("/resize") @app.route("/resize")
def resize() def resize():
u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first() u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first()
print(u.username) print(u.username)
print(f"1 {u.profileurl}") print(f"1 {u.profileurl}")

View File

@ -20,10 +20,11 @@ beams_client = PushNotifications(
) )
@app.route("/@<username>/suicide") @app.route("/@<username>/suicide")
@limiter.limit("1/hour")
@auth_required @auth_required
def suicide(v, username): def suicide(v, username):
t = int(time()) #t = int(time())
if t - v.suicide_utc < 86400: abort(403) #if t - v.suicide_utc < 86400: abort(403)
user = get_user(username) user = get_user(username)
suicide = f"""Hi there, 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.""" Your fellow dramatards care about you and there are people who want to help."""
send_notification(1046, user, suicide) send_notification(1046, user, suicide)
v.suicide_utc = t #v.suicide_utc = t
g.db.add(v) #g.db.add(v)
return "", 204 return "", 204
@app.route("/api/v1/user/<username>", methods=["GET"]) @app.route("/api/v1/user/<username>", methods=["GET"])