forked from MarseyWorld/MarseyWorld
sneed
parent
363d9f7f7a
commit
fab10bcc36
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue