sporttracksexport bug fixing
This commit is contained in:
@@ -181,8 +181,10 @@ def createsporttracksworkoutdata(w):
|
|||||||
maxhr = int(row.df[' HRCur (bpm)'].max())
|
maxhr = int(row.df[' HRCur (bpm)'].max())
|
||||||
|
|
||||||
# adding diff, trying to see if this is valid
|
# 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]
|
t[0] = t[1]
|
||||||
|
|
||||||
d = row.df.ix[:,'cum_dist'].values
|
d = row.df.ix[:,'cum_dist'].values
|
||||||
d[0] = d[1]
|
d[0] = d[1]
|
||||||
t = t.astype(int)
|
t = t.astype(int)
|
||||||
@@ -196,9 +198,12 @@ def createsporttracksworkoutdata(w):
|
|||||||
try:
|
try:
|
||||||
lat = row.df[' latitude'].values
|
lat = row.df[' latitude'].values
|
||||||
lon = row.df[' longitude'].values
|
lon = row.df[' longitude'].values
|
||||||
|
if not lat.std() and not lon.std():
|
||||||
|
haslatlon = 0
|
||||||
except KeyError:
|
except KeyError:
|
||||||
haslatlon = 0
|
haslatlon = 0
|
||||||
|
|
||||||
|
|
||||||
haspower = 1
|
haspower = 1
|
||||||
try:
|
try:
|
||||||
power = row.df[' Power (watts)'].values
|
power = row.df[' Power (watts)'].values
|
||||||
|
|||||||
@@ -1078,7 +1078,6 @@ def workout_sporttracks_upload_view(request,id=0):
|
|||||||
url = "https://api.sporttracks.mobi/api/v2/fitnessActivities.json"
|
url = "https://api.sporttracks.mobi/api/v2/fitnessActivities.json"
|
||||||
response = requests.post(url,headers=headers,data=json.dumps(data))
|
response = requests.post(url,headers=headers,data=json.dumps(data))
|
||||||
|
|
||||||
|
|
||||||
# check for duplicate error first
|
# check for duplicate error first
|
||||||
if (response.status_code == 409 ):
|
if (response.status_code == 409 ):
|
||||||
message = "Duplicate error"
|
message = "Duplicate error"
|
||||||
@@ -1093,7 +1092,7 @@ def workout_sporttracks_upload_view(request,id=0):
|
|||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
else:
|
else:
|
||||||
s = response
|
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:
|
else:
|
||||||
message = "You are not authorized to upload this workout"
|
message = "You are not authorized to upload this workout"
|
||||||
|
|||||||
Reference in New Issue
Block a user