bug fix upload
This commit is contained in:
@@ -1205,7 +1205,10 @@ def parsenonpainsled(fileformat,f2,summary):
|
|||||||
fileformat = fileformat+'v'+str(empowerfirmware)
|
fileformat = fileformat+'v'+str(empowerfirmware)
|
||||||
else:
|
else:
|
||||||
fileformat = 'speedcoach2v0'
|
fileformat = 'speedcoach2v0'
|
||||||
summary = row.allstats()
|
try:
|
||||||
|
summary = row.allstats()
|
||||||
|
except ZeroDivisionError:
|
||||||
|
summary = ''
|
||||||
|
|
||||||
|
|
||||||
# handle FIT
|
# handle FIT
|
||||||
@@ -1225,18 +1228,14 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
|||||||
inboard = 0.88
|
inboard = 0.88
|
||||||
hasrecognized = False
|
hasrecognized = False
|
||||||
|
|
||||||
try:
|
row,hasrecognized,summary,fileformat = parsenonpainsled(fileformat,f2,summary)
|
||||||
row,hasrecognized,summary,fileformat = parsenonpainsled(fileformat,f2,summary)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# Handle c2log
|
# Handle c2log
|
||||||
if (fileformat == 'c2log' or fileformat == 'rowprolog'):
|
if (fileformat == 'c2log' or fileformat == 'rowprolog'):
|
||||||
return (0,0,0,0,0)
|
return (0,'',0,0,'')
|
||||||
|
|
||||||
if not hasrecognized:
|
if not hasrecognized:
|
||||||
return (0,0,0,0,0)
|
return (0,'',0,0,'')
|
||||||
|
|
||||||
f_to_be_deleted = f2
|
f_to_be_deleted = f2
|
||||||
# should delete file
|
# should delete file
|
||||||
@@ -1245,7 +1244,7 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
|||||||
row2 = rrdata(df = row.df)
|
row2 = rrdata(df = row.df)
|
||||||
row2.write_csv(f2, gzip=True)
|
row2.write_csv(f2, gzip=True)
|
||||||
except:
|
except:
|
||||||
return (0,0,0,0,0)
|
return (0,'',0,0,'')
|
||||||
|
|
||||||
# os.remove(f2)
|
# os.remove(f2)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from rowers.models import Workout, PowerTimeFitnessMetric, Rower
|
from rowers.models import Workout, PowerTimeFitnessMetric, Rower, PaidPlan
|
||||||
import datetime
|
import datetime
|
||||||
from rowers.utils import myqueue
|
from rowers.utils import myqueue
|
||||||
import django_rq
|
import django_rq
|
||||||
|
|||||||
Reference in New Issue
Block a user