From 08c8953c9cdec9d0c1778f8f77f0470bf8774333 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 8 Oct 2019 00:50:27 +0200 Subject: Checking if player in butler is present in lineup and reacting appropriately if not Fixes #10 --- ausbutler/interface.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ausbutler/interface.py b/ausbutler/interface.py index 172abfa..c8bd2b9 100644 --- a/ausbutler/interface.py +++ b/ausbutler/interface.py @@ -88,6 +88,11 @@ class Interface(object): aus_b.score, self.config['cutoff_point'], self.config['cutoff_rate']) + if aus_b.table is None: + raise ValueError( + 'player ID=%d has butler (round %d, segment %d), but is missing from lineup!' % ( + aus_b.id, aus_b.match, aus_b.segment + )) aus_b.board_count = aus_b.table.butler_count[ get_room(aus_b, butler.id)] self.session.add(aus_b) -- cgit v1.2.3