oct-election::valid_voters (public)
oct-election::valid_voters [ -status status ] -election_id election_id
Defined in packages/oct-election/tcl/oct-election-procs.tcl
Return a list of valid voters
- Switches:
- -status (optional, defaults to
"not_voted"
)- Could be "voted" or "non_voted", reflecting the voters who have voted for the elections already and the ones who did not vote yet.
- -election_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if {$status eq "voted"} { return [db_list voters "select u. user_id from cc_users u, (select count(user_id) as ballot,user_id from oct_ballot o where election_id = 5 group by user_id) ballots where ballots.user_id = u.user_id and ballot > 0 and u.member_state = 'approved'"] ad_script_abort } else { set voter_ids [list] db_foreach possible_voter "select u. user_id from cc_users u where u.member_state = 'approved'" { # Check if the user is actually allowed to vote set valid_voter [oct-election::valid_voter_p -election_id $election_id -user_id $user_id] set valid_voter_p [lindex $valid_voter 0] if {$valid_voter_p} { lappend voter_ids $user_id } } } return $voter_idsXQL Not present: Generic, PostgreSQL, Oracle