Skip to content

Commit

Permalink
Bugfix, take 2: Fetching personal data failed if running in a non-con…
Browse files Browse the repository at this point in the history
…cluded election with unordered results (such as STV).
  • Loading branch information
helgihg committed Sep 23, 2018
1 parent a4e0784 commit 2bbf5e1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,16 @@ def make_zipfile(output_filename, source_dir):
election_export = []
for election in elections:

if election.results_are_ordered:
try:
try:
if election.results_are_ordered:
user_place = election.result.rows.get(candidate__user_id=user.id).order
except ElectionResult.DoesNotExist:
user_place = 'not-yet-determined'
else:
if election.result.rows.filter(candidate__user_id=user.id).exists():
user_place = 'selected'
else:
user_place = 'not-selected'
if election.result.rows.filter(candidate__user_id=user.id).exists():
user_place = 'selected'
else:
user_place = 'not-selected'
except ElectionResult.DoesNotExist:
user_place = 'not-yet-determined'

election_export.append({
'name': election.name,
Expand Down

0 comments on commit 2bbf5e1

Please sign in to comment.