On Thu, Mar 26, 2015 at 5:49 AM, <humbed...@apache.org> wrote:
>...

> +++ steve/trunk/pysteve/lib/election.py Thu Mar 26 10:49:08 2015
> @@ -158,9 +158,16 @@ def vote(electionID, issueID, voterID, v
>      "Casts a vote on an issue"
>      votes = {}
>      basedata = getBasedata(electionID)
> -    if basedata:
> +    issueData = getIssue(electionID, issueID)
> +    if basedata and issueData:
>          votehash = hashlib.sha224(basedata['hash'] + issueID + voterID +
> vote).hexdigest()
>
> +        # Vote verification
> +        voteType = getVoteType(issueData)
> +        if 'vote_func' in voteType and voteType['vote_func']:
>

Much easier:

  if voteType.get('vote_func'):


>...

Cheers,
-g

Reply via email to