check if version file exists

This commit is contained in:
Bui
2018-10-10 22:15:16 +01:00
parent e2ad2b2737
commit 3d764eb605
2 changed files with 10 additions and 2 deletions

4
app.py
View File

@@ -69,7 +69,9 @@ def close_connection(exception):
@app.route('/')
def route_index():
version = json.load(open('version.json', 'r'))
version = None
if os.path.isfile('version.json'):
version = json.load(open('version.json', 'r'))
return render_template('index.html', version=version)