diff --git a/drama/helpers/aws.py b/drama/helpers/aws.py index ddb1911eb..1e71dfaf2 100644 --- a/drama/helpers/aws.py +++ b/drama/helpers/aws.py @@ -68,8 +68,6 @@ def upload_file(name, file, resize=None): print(e) print(req) print(req.text) - if "File type invalid" in req.text: return "sex" - else: return else: req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {imgurkey}"}, data = {'image': base64.b64encode(file.read())}) try: resp = req.json()['data'] @@ -82,7 +80,8 @@ def upload_file(name, file, resize=None): print(e) print(req) print(req.text) - return + if "File type invalid" in req.text: return "sex" + else: return new_image = Image( text=url,