pcm
This commit is contained in:
parent
368e4017ad
commit
64b7c25894
1 changed files with 15 additions and 1 deletions
|
@ -852,7 +852,21 @@ def submit_post(v):
|
||||||
if file.content_type.startswith('image/'):
|
if file.content_type.startswith('image/'):
|
||||||
new_post.url = upload_ibb(file)
|
new_post.url = upload_ibb(file)
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
new_post.url = upload_video(file)
|
new_post.url = upload_video(file)
|
||||||
|
except UploadException as e:
|
||||||
|
if request.headers.get("Authorization"):
|
||||||
|
return {
|
||||||
|
"error": str(e),
|
||||||
|
}, 400
|
||||||
|
else:
|
||||||
|
return render_template(
|
||||||
|
"submit.html",
|
||||||
|
v=v,
|
||||||
|
error=str(e),
|
||||||
|
title=title,
|
||||||
|
body=request.form.get("body", "")
|
||||||
|
), 400
|
||||||
else:
|
else:
|
||||||
if file.content_type.startswith('image/'):
|
if file.content_type.startswith('image/'):
|
||||||
new_post.url = upload_imgur(file)
|
new_post.url = upload_imgur(file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue