You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2026/01/13 16:13:44 UTC

(tooling-trusted-releases) branch main updated: Parenthesize subexpressions and fix a pluralisation bug

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 4911170  Parenthesize subexpressions and fix a pluralisation bug
4911170 is described below

commit 4911170fcde0927475f6f3e20a262297b6f52814
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Tue Jan 13 16:13:21 2026 +0000

    Parenthesize subexpressions and fix a pluralisation bug
---
 atr/db/interaction.py | 6 +++---
 atr/get/finish.py     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/atr/db/interaction.py b/atr/db/interaction.py
index 46c272c..beef1ec 100644
--- a/atr/db/interaction.py
+++ b/atr/db/interaction.py
@@ -405,11 +405,11 @@ async def trusted_jwt_for_version(
         release = await db_data.release(project_name=project.name, version=version_name).get()
         if not release:
             raise InteractionError(f"Release {version_name} does not exist in project {project.name}")
-        if phase == TrustedProjectPhase.COMPOSE and release.phase != sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT:
+        if (phase == TrustedProjectPhase.COMPOSE) and (release.phase != sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT):
             raise InteractionError(f"Release {version_name} is not in compose phase")
-        if phase == TrustedProjectPhase.VOTE and release.phase != sql.ReleasePhase.RELEASE_CANDIDATE:
+        if (phase == TrustedProjectPhase.VOTE) and (release.phase != sql.ReleasePhase.RELEASE_CANDIDATE):
             raise InteractionError(f"Release {version_name} is not in vote phase")
-        if phase == TrustedProjectPhase.FINISH and release.phase != sql.ReleasePhase.RELEASE_PREVIEW:
+        if (phase == TrustedProjectPhase.FINISH) and (release.phase != sql.ReleasePhase.RELEASE_PREVIEW):
             raise InteractionError(f"Release {version_name} is not in finish phase")
 
     return payload, asf_uid, project
diff --git a/atr/get/finish.py b/atr/get/finish.py
index 0447e17..1438fd3 100644
--- a/atr/get/finish.py
+++ b/atr/get/finish.py
@@ -231,7 +231,7 @@ def _render_distribution_tasks(release: sql.Release, tasks: Sequence[sql.Task])
     block = htm.Block()
 
     if len(failed_tasks) > 0:
-        summary = f"{len(failed_tasks)} distribution{'s' if len(failed_tasks) > 1 else ''} failed for this release"
+        summary = f"{len(failed_tasks)} distribution{'s' if (len(failed_tasks) != 1) else ''} failed for this release"
         block.append(
             htm.div(".alert.alert-danger.mb-3")[
                 htm.h3["Failed distributions"],


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org