From cd4faf861a7434de9a8b9922a148cc0774a0bfb6 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 4 Jan 2018 08:54:16 +0100 Subject: [PATCH] error checking around rdata in updateergcp --- rowers/tasks.py | 12 +++++++++++- rowers/templates/.#oterankings.html | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) delete mode 100644 rowers/templates/.#oterankings.html diff --git a/rowers/tasks.py b/rowers/tasks.py index e40aa000..f17fb216 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -493,7 +493,17 @@ def handle_otwsetpower(self,f1, boattype, weightvalue, def handle_updateergcp(rower_id,workoutfilenames,debug=False,**kwargs): therows = [] for f1 in workoutfilenames: - rowdata = rdata(f1) + try: + rowdata = rdata(f1) + except IOError: + try: + rowdata = rdata(f1 + '.csv') + except IOError: + try: + rowdata = rdata(f1 + '.gz') + except IOError: + rowdata = 0 + if rowdata != 0: therows.append(rowdata) diff --git a/rowers/templates/.#oterankings.html b/rowers/templates/.#oterankings.html deleted file mode 100644 index 0075ef80..00000000 --- a/rowers/templates/.#oterankings.html +++ /dev/null @@ -1 +0,0 @@ -E408191@CZ27LT9RCGN72.63064:1514927368 \ No newline at end of file