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-release.git
The following commit(s) were added to refs/heads/main by this push:
new 0fa9dd0 Fix a bug with casting a vote in the UI
0fa9dd0 is described below
commit 0fa9dd06affe734b6171f6c253716c46e45cdd88
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Sep 10 20:30:48 2025 +0100
Fix a bug with casting a vote in the UI
---
atr/routes/vote.py | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/atr/routes/vote.py b/atr/routes/vote.py
index 11095b2..bed8378 100644
--- a/atr/routes/vote.py
+++ b/atr/routes/vote.py
@@ -117,12 +117,34 @@ async def selected_post(session: routes.CommitterSession,
project_name: str, ver
"""Handle submission of a vote."""
await session.check_access(project_name)
+ # Ensure the release exists and is in the correct phase
+ release = await session.release(project_name, version_name,
phase=sql.ReleasePhase.RELEASE_CANDIDATE)
+
+ if release.committee is None:
+ raise ValueError("Release has no committee")
+
+ # Set up form choices
+ async with storage.write() as write:
+ try:
+ if release.committee.is_podling:
+ _wacm = write.as_committee_member("incubator")
+ else:
+ _wacm = write.as_committee_member(release.committee.name)
+ potency = "Binding"
+ except storage.AccessError:
+ potency = "Non-binding"
+
form = await CastVoteForm.create_form(data=await quart.request.form)
+ forms.choices(
+ form.vote_value,
+ choices=[
+ ("+1", f"+1 ({potency})"),
+ ("0", "0"),
+ ("-1", f"-1 ({potency})"),
+ ],
+ )
if await form.validate_on_submit():
- # Ensure the release exists and is in the correct phase
- release = await session.release(project_name, version_name,
phase=sql.ReleasePhase.RELEASE_CANDIDATE)
-
vote = str(form.vote_value.data)
comment = str(form.vote_comment.data)
email_recipient, error_message = await _send_vote(session, release,
vote, comment)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]