From 29ec140f34dc5dc609572445a3a19bd5dcaed147 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 17 Jan 2017 01:34:30 +0100 Subject: Proper links to old butler (normalized or not) --- ausbutler/interface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ausbutler/interface.py') diff --git a/ausbutler/interface.py b/ausbutler/interface.py index ef0dbd1..bf36c44 100644 --- a/ausbutler/interface.py +++ b/ausbutler/interface.py @@ -21,6 +21,7 @@ class Interface(object): self.translation = Translations() self.template = Environment(loader=FileSystemLoader('template')) self.template.filters['translate'] = self.translation.get_translation + self.old_butler_normalized = False def calculate_all(self): self.init_db() @@ -44,6 +45,7 @@ class Interface(object): ) try: old_normbutler = self.session.execute(old_normbutler_query) + self.old_butler_normalized = True print 'WARNING: Old butler was normalized, but will not be normalized with scores from current tournament' except ProgrammingError: print 'WARNING: Old butler was not normalized, will only be used to calculate opponent score' @@ -83,7 +85,7 @@ class Interface(object): def __filter_opp_score(self, butler, opp_butler): if self.config['only_current']: return opp_butler.match < butler.match or \ - (opp_butler.match == butler.match and \ + (opp_butler.match == butler.match and opp_butler.segment <= butler.segment) else: return True @@ -212,7 +214,7 @@ class Interface(object): segments.append({ 'round': 0, 'segment': 0, 'label': Constants.oldbutler, - 'link': '%sleaderb.html' % old_prefix + 'link': ('%snormbutler.html' if self.old_butler_normalized else '%sbutler.html') % old_prefix }) result_template.append('') for rnd in range(1, Constants.rnd + 1): -- cgit v1.2.3