From a29981d58bc334100cf1cd3946d27a1e5f69ce7c Mon Sep 17 00:00:00 2001 From: Chuan-Zheng Lee Date: Mon, 25 May 2020 02:34:01 -0700 Subject: [PATCH] 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. --- tabbycat/results/result.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tabbycat/results/result.py b/tabbycat/results/result.py index f22edededd2..80560a66917 100644 --- a/tabbycat/results/result.py +++ b/tabbycat/results/result.py @@ -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: