Don't use os.path.join for URI since this breaks on windows.

This commit is contained in:
Jennifer Taylor
2022-11-01 04:22:58 +00:00
parent 3dea5df10e
commit 3b020c783d

View File

@@ -223,7 +223,7 @@ def render_react(
"react.html",
**{
"title": title,
"reactbase": os.path.join("controllers", controller),
"reactbase": f"controllers/{controller}",
"inits": inits,
"links": links,
},
@@ -321,8 +321,10 @@ def jinja2_theme(filename: str) -> str:
@app.context_processor
def navigation() -> Dict[str, Any]:
# Look up JSX components we should provide for every page load
# Intentionally always use / to join for the top level since this
# is returning a URI.
components = [
os.path.join("components", f)
f"components/{f}"
for f in os.listdir(os.path.join(static_location, "components"))
if re.search(r"\.react\.js$", f)
]