sneed
parent
bd570f0863
commit
a460d8bcde
|
@ -80,8 +80,6 @@ def upload_file(name, file, resize=None):
|
|||
print(e)
|
||||
print(req)
|
||||
print(req.text)
|
||||
if "File type invalid" in str(req.text): return "sex"
|
||||
else: return
|
||||
|
||||
new_image = Image(
|
||||
text=url,
|
||||
|
|
|
@ -34,10 +34,11 @@ def resize():
|
|||
file.write(chunk)
|
||||
|
||||
image = upload_from_file("resizing", "resizing", (100, 100))
|
||||
if image == "sex":
|
||||
if image == None:
|
||||
send_notification(1, u, "fail!")
|
||||
u.resized = True
|
||||
g.db.add(u)
|
||||
elif image != None:
|
||||
else:
|
||||
u.profileurl = image
|
||||
u.resized = True
|
||||
g.db.add(u)
|
||||
|
|
Loading…
Reference in New Issue