Open ostasevych opened 3 years ago
Simple fix:
CastVotes = CastVote.objects.all().filter(vote_hash = self.vote_hash)
for castvote in CastVotes:
pass
return CastVotes.last().vote_tinyhash
Probably last() should be used, as we are going to take the last vote()? Am I right?
I have caught the error when trying to click the link next 50 in the list of voters in the Ballot Tracking Centre:
helios.models.MultipleObjectsReturned: get() returned more than one CastVote -- it returned 2!
Trying to investigate it I found that this is caused by ambiguity of the uniqueness of data, see more: https://stackoverflow.com/questions/22063748/django-get-returned-more-than-one-topic/66284066#66284066
I tried to follow the advise and replaced get() with filter() in models.py:
However, if I add the vote.tinyhash at the end I am getting error:
If I am omitting it the url of the ballot appears to be broken, eg:
What and how it may be fixed?