Skip to content

Commit

Permalink
Make set_score silently fail if adj not in debate
Browse files Browse the repository at this point in the history
This makes `VotingDebateResult.set_score(adjudicator, *args)` fail
silently if there isn't a scoresheet for `adjudicator`, which
(should) happen if the adjudicator isn't assigned to that debate.
It logs an exception, so the failure isn't completely silent, but
it doesn't alert the user immediately.

Relates to #922. I'm not yet sure if making this silently fail
might cause problems later.
  • Loading branch information
czlee committed May 25, 2020
1 parent fdf8498 commit a29981d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tabbycat/results/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,9 @@ def set_score(self, adjudicator, side, position, score):
try:
scoresheet = self.scoresheets[adjudicator]
except KeyError:
logger.exception("Adjudicator %s has a scoresheet but is not assigned \
to this debate. This debate's panel has probably been changed since \
this ballot was loaded for entry. Best to return to the results page \
and re-enter this ballot from scratch.", adjudicator.name)
logger.exception("Tried to set score by adjudicator %s, but this adjudicator "
"doesn't have a scoresheet.", adjudicator)
return
try:
scoresheet.set_score(side, position, score)
except AttributeError:
Expand Down

0 comments on commit a29981d

Please sign in to comment.