This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new 63a61445 Fix parentheses
63a61445 is described below
commit 63a61445fc07f46b162427ba2d10a26c3e414127
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Mar 5 15:46:14 2026 +0000
Fix parentheses
---
atr/blueprints/common.py | 4 ++--
atr/blueprints/post.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/atr/blueprints/common.py b/atr/blueprints/common.py
index d12b4446..d705deb3 100644
--- a/atr/blueprints/common.py
+++ b/atr/blueprints/common.py
@@ -85,7 +85,7 @@ def build_path(
if hint is None:
raise TypeError(f"Parameter {param_name!r} in {func.__name__} has
no type annotation")
- if hint is web.Public or hint is web.Committer:
+ if (hint is web.Public) or (hint is web.Committer):
if ix != 0:
raise TypeError(f"Parameter {param_name!r} in {func.__name__}
must be first")
public = hint is web.Public
@@ -158,7 +158,7 @@ def _is_form_type(hint: Any) -> bool:
hint = hint.__value__
if get_origin(hint) is Annotated:
args = get_args(hint)
- return len(args) >= 2 and form.DISCRIMINATOR in args[1:]
+ return (len(args) >= 2) and (form.DISCRIMINATOR in args[1:])
return False
diff --git a/atr/blueprints/post.py b/atr/blueprints/post.py
index 8224d281..7968922e 100644
--- a/atr/blueprints/post.py
+++ b/atr/blueprints/post.py
@@ -65,14 +65,14 @@ def typed(func: Callable[..., Any]) ->
web.RouteFunction[Any]:
"""
path, validated_params, literal_params, form_param, public =
common.build_path(func)
project_name_var = next((name for name, t in validated_params if t is
safe.ProjectName), None)
- check_access = not public and (project_name_var is not None)
+ check_access = (not public) and (project_name_var is not None)
async def wrapper(*_args: Any, **kwargs: Any) -> Any:
enhanced_session = await common.authenticate_public() if public else
await common.authenticate()
await common.run_validators(kwargs, validated_params)
kwargs.update(literal_params)
- if check_access and enhanced_session is not None and project_name_var
is not None:
+ if check_access and (enhanced_session is not None) and
(project_name_var is not None):
await enhanced_session.check_access(str(kwargs[project_name_var]))
if form_param is not None:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]