master
Aevann1 2021-08-04 20:43:04 +02:00
parent e45bda21b8
commit 6a9e7a44d4
2 changed files with 2 additions and 4 deletions

View File

@ -31,7 +31,7 @@ app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3)
app.url_map.strict_slashes = False
app.config["SITE_NAME"]=environ.get("SITE_NAME").strip()
app.config["coins_name"]=environ.get("SITE_NAME").strip()
app.config["coins_name"]=environ.get("coins_name").strip()
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['DATABASE_URL'] = environ.get("DATABASE_CONNECTION_POOL_URL",environ.get("DATABASE_URL"))

View File

@ -38,9 +38,7 @@ def upload_file(file=None, resize=False, png=False):
req = requests.post('https://api.imgur.com/3/upload.json', headers = {"Authorization": f"Client-ID {imgurkey}"}, data=data)
resp = req.json()['data']
url = resp['link'].replace(".png", "_d.png").replace(".jpg", "_d.jpg").replace(".jpeg", "_d.jpeg") + "?maxwidth=9999"
except:
print(req.text)
return
except: return
new_image = Image(text=url, deletehash=resp["deletehash"])
g.db.add(new_image)