This is an automated email from the ASF dual-hosted git repository.

arm pushed a commit to branch arm
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/arm by this push:
     new eadf18d4 Add some missing underscore prefixes and an explicit notfound 
route - use that route on test/login when disabled (for #784)
eadf18d4 is described below

commit eadf18d44eb507cb370cf95da2383ed3de1b1ab6
Author: Alastair McFarlane <[email protected]>
AuthorDate: Fri Mar 6 16:30:37 2026 +0000

    Add some missing underscore prefixes and an explicit notfound route - use 
that route on test/login when disabled (for #784)
---
 atr/get/root.py | 15 ++++++++++++---
 atr/get/test.py |  2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/atr/get/root.py b/atr/get/root.py
index 26707ef5..566be9ec 100644
--- a/atr/get/root.py
+++ b/atr/get/root.py
@@ -146,7 +146,16 @@ async def index(_session: web.Public, _root: Literal[""]) 
-> quart_response.Resp
 
 
 @get.typed
-async def policies(session: web.Public, _policies: Literal["policies"]) -> str:
+async def notfound(_session: web.Public, _about: Literal["notfound"]) -> str:
+    """
+    URL: /notfound
+    Not found page.
+    """
+    return await template.render("notfound.html", error="404 Not Found", 
status_code=404)
+
+
[email protected]
+async def policies(_session: web.Public, _policies: Literal["policies"]) -> 
str:
     """
     URL: /policies
     """
@@ -155,7 +164,7 @@ async def policies(session: web.Public, _policies: 
Literal["policies"]) -> str:
 
 @get.typed
 async def resolved_json(
-    session: web.Public, _miscellaneous_resolved_json: 
Literal["miscellaneous/resolved.json"]
+    _session: web.Public, _miscellaneous_resolved_json: 
Literal["miscellaneous/resolved.json"]
 ) -> quart_response.Response:
     """
     URL: /miscellaneous/resolved.json
@@ -168,7 +177,7 @@ async def resolved_json(
 
 
 @get.typed
-async def tutorial(session: web.Committer, _tutorial: Literal["tutorial"]) -> 
str:
+async def tutorial(_session: web.Committer, _tutorial: Literal["tutorial"]) -> 
str:
     """
     URL: /tutorial
     Tutorial page.
diff --git a/atr/get/test.py b/atr/get/test.py
index f480e6b2..7d36472f 100644
--- a/atr/get/test.py
+++ b/atr/get/test.py
@@ -67,7 +67,7 @@ async def test_login(_session: web.Public, _test_login: 
Literal["test/login"]) -
     URL: /test/login
     """
     if not config.get().ALLOW_TESTS:
-        raise base.ASFQuartException("Test login not enabled", errorcode=404)
+        return await web.redirect(root.notfound)
 
     session_data = atr.models.session.CookieData(
         uid="test",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to