From de62a36fa747968d7d9e31ddce0ab41dfb08323d Mon Sep 17 00:00:00 2001 From: Timothy Allen Date: Wed, 17 Oct 2018 20:21:01 +0200 Subject: [PATCH] Minor tweaks. --- load_spreadsheet.py | 4 ++-- templates/list-top.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/load_spreadsheet.py b/load_spreadsheet.py index 0259641..412d7e1 100755 --- a/load_spreadsheet.py +++ b/load_spreadsheet.py @@ -56,7 +56,7 @@ def main(): spreadsheets = [] uniqurl = [] wpa = 'http://www.wpa.org.za/Events/DynamicEvents.asmx/BuildEventDisplay' - for year in range(2016, dt.datetime.now().year + 1): + for year in range(2018, dt.datetime.now().year + 1): log.debug("Finding results for {}".format(year)); args = {"WPAExtra":"True","TimeColumn":"True","entityid":"674417","selectedyear":year,"selectedmonth":0,"commissionid":"0","selectedstate":"0","categoryid":0,"themeid":"46"} data = bytes(json.dumps(args).encode('utf8')) @@ -99,7 +99,7 @@ def main(): filename = os.path.basename(urlparts.path) if re.search('WALKRESULTS', filename, flags=re.IGNORECASE): continue - log.info("Loading data from URL {}".format(url)) + log.warning("Loading data from URL {}".format(url)) filepath = os.path.join(tmpdir, filename) with open(filepath, 'wb') as fp: fp.write(data) diff --git a/templates/list-top.html b/templates/list-top.html index bed0d30..5195e8c 100644 --- a/templates/list-top.html +++ b/templates/list-top.html @@ -35,7 +35,7 @@ Date {{ row.date|cleandate|e }} Notes {%- if row.sex and row.sexposition and row.sexposition | int <= 100 %}{{ row.sexposition|ordinal|e }} {{ row.sex|lower|gender|e }}{% endif -%} - {%- if row.sexposition and row.sexposition | int <= 100 and row.catposition and row.catposition | int <= 100 %} and {% endif -%} + {%- if row.sex and row.sexposition and row.sexposition | int <= 100 and row.catposition and row.catposition | int <= 100 %} and {% endif -%} {%- if row.catposition and row.catposition | int <= 100 %}{{ row.catposition|ordinal|e }} in category{% endif -%}