fd
This commit is contained in:
parent
4e29867c61
commit
b6bb7a6978
2 changed files with 6 additions and 5 deletions
|
@ -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}")
|
||||
|
|
|
@ -20,10 +20,11 @@ beams_client = PushNotifications(
|
|||
)
|
||||
|
||||
@app.route("/@<username>/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/<username>", methods=["GET"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue