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