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

gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git

commit 59c991776e2f3389cebc40083d04cb33c8b57364
Author: Greg Stein <[email protected]>
AuthorDate: Fri Feb 27 07:39:07 2026 -0600

    feat: add get_voters_for_email method and include name in voting persons 
query
    
    Co-authored-by: aider (openrouter/x-ai/grok-code-fast-1) <[email protected]>
---
 v3/queries.yaml      | 2 +-
 v3/steve/election.py | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/v3/queries.yaml b/v3/queries.yaml
index 6999590..ae72220 100644
--- a/v3/queries.yaml
+++ b/v3/queries.yaml
@@ -160,7 +160,7 @@ election:
         ORDER BY e._ROWID_
 
     q_voting_persons: |
-        SELECT DISTINCT m.pid, p.email
+        SELECT DISTINCT m.pid, p.name, p.email
         FROM mayvote m
         JOIN issue i ON m.iid = i.iid
         JOIN person p ON m.pid = p.pid
diff --git a/v3/steve/election.py b/v3/steve/election.py
index e861b9a..ab7e914 100644
--- a/v3/steve/election.py
+++ b/v3/steve/election.py
@@ -531,6 +531,14 @@ class Election:
         "Set the close_at timestamp for this Election."
         self.c_set_close_at.perform(timestamp, self.eid)
 
+    def get_voters_for_email(self):
+        "Return a list of distinct voters (pid, name, email) eligible for this 
election."
+        self.q_voting_persons.perform(self.eid)
+        return [
+            {'pid': row.pid, 'name': row.name, 'email': row.email}
+            for row in self.q_voting_persons.fetchall()
+        ]
+
 
 def not_found(cursor, key):
     row = cursor.first_row(key)

Reply via email to