Private
Public Access
1
0

sporttracksexport bug fixing

This commit is contained in:
Sander Roosendaal
2017-01-05 17:10:33 +01:00
parent 5f45d385f3
commit 1f056096d7
2 changed files with 7 additions and 3 deletions

View File

@@ -181,8 +181,10 @@ def createsporttracksworkoutdata(w):
maxhr = int(row.df[' HRCur (bpm)'].max())
# adding diff, trying to see if this is valid
t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
t = row.df.ix[:,'TimeStamp (sec)'].values-row.df.ix[0,'TimeStamp (sec)']
t[0] = t[1]
d = row.df.ix[:,'cum_dist'].values
d[0] = d[1]
t = t.astype(int)
@@ -196,9 +198,12 @@ def createsporttracksworkoutdata(w):
try:
lat = row.df[' latitude'].values
lon = row.df[' longitude'].values
if not lat.std() and not lon.std():
haslatlon = 0
except KeyError:
haslatlon = 0
haspower = 1
try:
power = row.df[' Power (watts)'].values

View File

@@ -1078,7 +1078,6 @@ def workout_sporttracks_upload_view(request,id=0):
url = "https://api.sporttracks.mobi/api/v2/fitnessActivities.json"
response = requests.post(url,headers=headers,data=json.dumps(data))
# check for duplicate error first
if (response.status_code == 409 ):
message = "Duplicate error"
@@ -1093,7 +1092,7 @@ def workout_sporttracks_upload_view(request,id=0):
return HttpResponseRedirect(url)
else:
s = response
message = "Something went wrong in workout_sporttracks_upload_view %s" % s
message = "Something went wrong in workout_sporttracks_upload_view: %s" % s.reason
else:
message = "You are not authorized to upload this workout"