This commit is contained in:
Aevann1 2021-12-10 20:40:48 +02:00
parent ac4fc57078
commit 577baf8374
3 changed files with 10 additions and 10 deletions

View file

@ -192,7 +192,7 @@ def api_comment(v):
file=request.files["file"]
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp'
name = f'/images/{time.time()}.webp'
file.save(name)
url = request.host_url[:-1] + process_image(name)
@ -721,7 +721,7 @@ def edit_comment(cid, v):
file=request.files["file"]
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
name = f'/images/{int(time.time())}{secrets.token_urlsafe(2)}.webp'
name = f'/images/{time.time()}.webp'
file.save(name)
url = request.host_url[:-1] + process_image(name)