summaryrefslogtreecommitdiff
path: root/ausbutler
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-10-02 23:15:45 +0200
committeremkael <emkael@tlen.pl>2017-10-02 23:15:45 +0200
commitedd1b14394d5c5fe1993e043352d7876273858e3 (patch)
treed0504563e21d22d5cf28d41c85c17bc8b99954a7 /ausbutler
parent6f4af30fec1cc6464f0234e37a83ab16e4e16fc6 (diff)
On butler continuation, exclude records for players which are not on player list for current event (e.g. when events split)
Diffstat (limited to 'ausbutler')
-rw-r--r--ausbutler/interface.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py
index 984b59b..eb08a6f 100644
--- a/ausbutler/interface.py
+++ b/ausbutler/interface.py
@@ -42,9 +42,9 @@ class Interface(object):
self.session.query(AusButler).delete()
if Constants.oldbutler is not None:
old_bulter_query = text(
- 'SELECT * FROM %s.butler' % Constants.oldbutler)
+ 'SELECT * FROM %s.butler WHERE id IN (SELECT id FROM players)' % Constants.oldbutler)
old_normbutler_query = text(
- 'SELECT id, SUM(cut_score), SUM(corrected_score) FROM %s.aus_butler GROUP BY id' % Constants.oldbutler
+ 'SELECT id, SUM(cut_score), SUM(corrected_score) FROM %s.aus_butler WHERE id IN (SELECT id FROM players) GROUP BY id' % Constants.oldbutler
)
try:
old_normbutler = self.session.execute(old_normbutler_query)