Skip to content
Snippets Groups Projects

Disable link to the storage page if it doesn't exist

Merged Dylan Aïssi requested to merge wip/daissi/storage-usage into master
All threads resolved!
Files
2
+ 9
1
@@ -116,12 +116,20 @@ def render(packaging_data, storage_data, destdir):
env = jinja2.Environment(
loader=jinja2.FileSystemLoader("templates/"), autoescape=True
)
if packaging_data is not None and storage_data is not None:
both_data = True
else:
both_data = False
for html, data in ("index", packaging_data), ("storage", storage_data):
if data is None:
continue
logging.debug(f"Generating {destdir}/{html}.html")
rendered = env.get_template(f"{html}.html.jinja2").render(**data)
rendered = env.get_template(f"{html}.html.jinja2").render(
**data, both_data=both_data
)
with open(destdir / f"{html}.html", "w") as html_file:
html_file.write(rendered)
Loading