Skip to content

Commit a29981d

Browse files
committed
Make set_score silently fail if adj not in debate
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.
1 parent fdf8498 commit a29981d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tabbycat/results/result.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,9 @@ def set_score(self, adjudicator, side, position, score):
540540
try:
541541
scoresheet = self.scoresheets[adjudicator]
542542
except KeyError:
543-
logger.exception("Adjudicator %s has a scoresheet but is not assigned \
544-
to this debate. This debate's panel has probably been changed since \
545-
this ballot was loaded for entry. Best to return to the results page \
546-
and re-enter this ballot from scratch.", adjudicator.name)
543+
logger.exception("Tried to set score by adjudicator %s, but this adjudicator "
544+
"doesn't have a scoresheet.", adjudicator)
545+
return
547546
try:
548547
scoresheet.set_score(side, position, score)
549548
except AttributeError:

0 commit comments

Comments
 (0)