From 59b4dc433305fcf656e66d5711e4e498012fb685 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Mon, 27 Feb 2017 14:11:55 +0100 Subject: [PATCH] added check for file length --- rowers/dataprep.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 71e6d585..c2ea9fdf 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -466,6 +466,11 @@ def new_workout_from_file(r,f2, message = "This C2 logbook summary does not contain stroke data. Please download the Export Stroke Data file from the workout details on the C2 logbook." return (0,message,f2) + if fileformat == 'nostrokes': + os.remove(f2) + message = "It looks like this file doesn't contain stroke data." + return (0,message,f2) + # Some people try to upload RowPro summary logs if fileformat == 'rowprolog': os.remove(f2)