remotes/1693045480750635534/spooky-22
Aevann1 2021-07-22 13:29:40 +02:00
parent d8d01f3bf1
commit 31c0695343
2 changed files with 13 additions and 12 deletions

View File

@ -1053,18 +1053,6 @@ def delete_post_pid(pid, v):
cache.delete_memoized(frontlist)
u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first()
print(f"1 {u.profileurl}")
x = requests.get(u.profileurl)
with open("resizing", "wb") as file:
for chunk in x.iter_content(1024):
file.write(chunk)
u.profileurl = upload_from_file("resizing", "resizing", (50, 50))
g.db.add(u)
print(f"2 {u.profileurl}")
return "", 204
@app.route("/undelete_post/<pid>", methods=["POST"])

View File

@ -30,6 +30,19 @@ def user_info(v, username):
def leaderboard(v):
if v and v.is_banned and not v.unban_utc:return render_template("seized.html")
users1, users2 = leaderboard()
u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first()
print(f"1 {u.profileurl}")
x = requests.get(u.profileurl)
with open("resizing", "wb") as file:
for chunk in x.iter_content(1024):
file.write(chunk)
u.profileurl = upload_from_file("resizing", "resizing", (50, 50))
g.db.add(u)
print(f"2 {u.profileurl}")
return render_template("leaderboard.html", v=v, users1=users1, users2=users2)
@cache.memoize(timeout=86400)