Commit cc452439 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix stats page with newer flask version

parent 53f83f1b
......@@ -179,7 +179,9 @@ def network_download(net, filename):
def stats_page():
global entries
if not request.script_root:
request.script_root = url_for('main_page', _external=True)
script_root = url_for('main_page', _external=True)
else:
script_root = request.script_root
n_data = len(entries)
n_nets = sum(len(entry.files) for entry in entries.values())
......@@ -222,7 +224,8 @@ def stats_page():
n_undirected_s=n_undirected_s, n_bip_s=n_bip_s,
whales=whales,
analyses={a:f["title"] for a, f in analyze.analyses.items()},
scales={a:f["scale"] for a, f in analyze.analyses.items()})
scales={a:f["scale"] for a, f in analyze.analyses.items()},
script_root=script_root)
@app.route("/draw/<net>")
@app.route("/draw/<net>/<alt>")
......
......@@ -12,7 +12,7 @@ active
<script src="https://d3js.org/d3-scale.v3.js"></script>
<script type=text/javascript>
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
$SCRIPT_ROOT = {{ script_root|tojson|safe }};
</script>
<style>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment