master
fireworks88 2021-07-25 13:13:29 +02:00
parent 363d9f7f7a
commit fab10bcc36
1 changed files with 17 additions and 16 deletions

View File

@ -25,24 +25,25 @@ with open("snappy.txt", "r") as f:
@app.route("/resize")
def resize():
u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first()
print(u.username)
print(f"1 {u.profileurl}")
x = requests.get(u.profileurl)
if u:
print(u.username)
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)
with open("resizing", "wb") as file:
for chunk in x.iter_content(1024):
file.write(chunk)
image = upload_from_file("resizing", "resizing", (100, 100))
if image == None:
send_notification(1, u, "fail!")
u.resized = True
g.db.add(u)
else:
u.profileurl = image
u.resized = True
g.db.add(u)
print(f"2 {u.profileurl}")
image = upload_from_file("resizing", "resizing", (100, 100))
if image == None:
send_notification(1, u, "fail!")
u.resized = True
g.db.add(u)
else:
u.profileurl = image
u.resized = True
g.db.add(u)
print(f"2 {u.profileurl}")
@app.route("/banaward/post/<post_id>")
@auth_required