fixed a bug when uploading non-images and using preview

This commit is contained in:
kageru 2018-08-21 17:57:04 +02:00
parent f8ce7acd7e
commit de884b1df9
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

View File

@ -51,7 +51,11 @@ def upload_local_file(path: str) -> None:
url = config.url_template.format(filename)
else:
url = curl_upload(path)
notify_user(url, path)
# Only pass the path when uploading an image
if re.search(r'\.(png|jpe?g|bmp)$', path):
notify_user(url, path)
else:
notify_user(url)
def prepare_file(ext: str) -> str: