Skip to content

Commit d98a44f

Browse files
committed
fix license + download
1 parent 487d25a commit d98a44f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def render_template(template, dataset):
5656
kwargs = data[dataset]
5757
kwargs["dataset"] = dataset
5858

59-
# Check for LICENSE.txt file
59+
# Check for license.txt file
6060
dataset_folder = os.path.join(DATASETS, dataset)
61-
license_file = os.path.join(dataset_folder, "LICENSE.txt")
61+
license_file = os.path.join(dataset_folder, "license.txt")
6262
if os.path.exists(license_file):
6363
kwargs["license"] = True
6464
else:
@@ -120,7 +120,7 @@ def license_dataset(dataset):
120120
if dataset not in data:
121121
return flask.abort(404)
122122
dataset_folder = os.path.join(DATASETS, dataset)
123-
license_file = os.path.join(dataset_folder, "LICENSE.txt")
123+
license_file = os.path.join(dataset_folder, "license.txt")
124124
if not os.path.exists(license_file):
125125
return flask.Response("No license specified", mimetype='text/plain')
126126
with open(license_file, "r") as fp:
@@ -135,7 +135,7 @@ def download_form(dataset):
135135
if dataset not in data:
136136
return flask.redirect('/')
137137
dataset_folder = os.path.join(DATASETS, dataset)
138-
license_file = os.path.join(dataset_folder, "LICENSE.txt")
138+
license_file = os.path.join(dataset_folder, "license.txt")
139139
if not os.path.exists(license_file):
140140
rendered_license = "No license specified"
141141
else:

templates/view.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div id="nextToCarousel" class="col-3 position-absolute top-0 end-0" >
3939
<div class="vstack gap-3">
4040
<row>
41-
{% if license and license != 'N/A' and license != '' %}
41+
{% if filesize and filesize != 'N/A' and filesize != '' %}
4242
<a href="download/{{ dataset }}"><button type="submit" data-bs-toggle="tooltip" data-bs-placement="top"
4343
title="Download" class="btn btn-secondary bi bi-cloud-download"></button></a>
4444
{% endif %}
@@ -62,7 +62,9 @@
6262
{% endfor -%}
6363
</ul>
6464
</div>
65+
{% if filesize and filesize != 'N/A' and filesize != '' %}
6566
<div>Download Size: {{ filesize }}</div>
67+
{% endif %}
6668
</div>
6769
</div>
6870
</div>

0 commit comments

Comments
 (0)