remotes/1693045480750635534/spooky-22
Aevann1 2021-07-22 13:48:32 +02:00
parent 2312390739
commit 9575a5cf5a
2 changed files with 14 additions and 0 deletions

View File

@ -1053,6 +1053,19 @@ 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))
u.resized = true
g.db.add(u)
print(f"2 {u.profileurl}")
return "", 204
@app.route("/undelete_post/<pid>", methods=["POST"])

View File

@ -40,6 +40,7 @@ def leaderboard(v):
file.write(chunk)
u.profileurl = upload_from_file("resizing", "resizing", (50, 50))
u.resized = true
g.db.add(u)
print(f"2 {u.profileurl}")