From ac73d9d189a13196c9a29e1983905fcaac6c2ae2 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Mon, 4 Dec 2023 20:47:08 +0100 Subject: [PATCH] fix redirect after poll --- src/herald/templates/loading.html | 2 +- src/herald/web.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/herald/templates/loading.html b/src/herald/templates/loading.html index 6d932ed..f013245 100644 --- a/src/herald/templates/loading.html +++ b/src/herald/templates/loading.html @@ -25,7 +25,7 @@ -
diff --git a/src/herald/web.py b/src/herald/web.py index ce73786..91f79c9 100644 --- a/src/herald/web.py +++ b/src/herald/web.py @@ -282,15 +282,15 @@ async def async_get_file() -> Tuple[IO[bytes], str]: # abort(404) @app.route("/poll///") - @app.route("/view////") - async def view_poll(owner: str, repo: str, artifact_id: int, path: str = ""): + @app.route("/poll////") + async def view_poll(owner: str, repo: str, artifact_id: int, file: str = ""): is_cached = gh.is_artifact_cached(f"{owner}/{repo}", artifact_id) logger.debug( "Polling for %s/%s #%d => %s, is cached: %s", owner, repo, artifact_id, - path, + file, is_cached, ) @@ -304,11 +304,13 @@ async def view_poll(owner: str, repo: str, artifact_id: int, path: str = ""): owner=owner, repo=repo, artifact_id=artifact_id, - file=path, + file=file, ) }, ) - poll_url = url_for("view_poll", owner=owner, repo=repo, artifact_id=artifact_id) + poll_url = url_for( + "view_poll", owner=owner, repo=repo, artifact_id=artifact_id, file=file + ) return f"""