summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-10-08 00:50:27 +0200
committeremkael <emkael@tlen.pl>2019-10-08 00:50:27 +0200
commit08c8953c9cdec9d0c1778f8f77f0470bf8774333 (patch)
tree741507691e61e45865a764575bc67db09f16374b
parent134f07b59a699d612a80856d41b9af583610d159 (diff)
Checking if player in butler is present in lineup and reacting appropriately if not
Fixes #10
-rw-r--r--ausbutler/interface.py5
1 files changed, 5 insertions, 0 deletions
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)