Correction d'erreur : le décompte des électeurs inscrits comptait les

personnes dont le compte avait été supprimé.
This commit is contained in:
eraviart 2003-12-23 16:53:16 +00:00
parent 28b4af92bc
commit ff0c14b26d
1 changed files with 6 additions and 4 deletions

View File

@ -169,7 +169,10 @@ class ElectionMixin(ObjectWebMixin):
registeredVotersCount = 0
abstentionsCount = 0
blanksCount = 0
voterIds = self.getVoterIds()
identitiesProxy = getProxyForServerRole('identities')
voterIds = [voterId
for voterId in self.getVoterIds()
if identitiesProxy.hasObject(voterId)]
registeredVotersCount = len(voterIds)
votes = ballotsWeb.getElectionVotes(self.voteTokens, voterIds)
nonAbstentionsCount = 0
@ -725,13 +728,12 @@ class ElectionsWeb(ObjectsWebMixin, ElectionsProxy):
layout = X.array()
layout += ObjectsWebMixin.getViewOtherActionButtonsBarLayout(
self, object, fields)
identitiesProxy = getProxyForServerRole('identities')
if object.state == 'running' \
and getProxyForServerRole('identities').setContainsUser(
object.votersSet):
and identitiesProxy.setContainsUser(object.votersSet):
layout += X.buttonStandalone(
'vote',
X.roleUrl('votes', 'edit').add('electionId', object.id))
identitiesProxy = getProxyForServerRole('identities')
if object.state == 'running' and \
(isAdmin or \
identitiesProxy.setContainsUser(object.writersSet)):