UEWBot / dipvis

Django-based visualiser for tournaments for the boardgame Diplomacy
GNU General Public License v3.0
7 stars 5 forks source link

KeyError exception on scores page in tournament_scores() #173

Closed UEWBot closed 1 year ago

UEWBot commented 3 years ago

Traceback:

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/ubuntu/dipvis/visualiser/tournament/tournament_views.py" in tournament_scores

  1. rs.append(str % r_scores[r][p.player])

Exception Type: KeyError at /tournaments/28/scores/ Exception Value:

UEWBot commented 3 years ago

This may have resulted from the messed up RoundPlayers - we know we had RoundPlayers that existed for Players who did not actually play in the Round. If so, the solution is to prevent that situation.

See also issue #170

UEWBot commented 1 year ago

The code in tournament_scores() has changed significantly since this was opened, and the issue hasn't been seen since, so this issue is not useful now.