Private
Public Access
1
0

bug fix strava & image

Detect existing workouts on Strava threw an error
Image upload sometimes gave a KeyError
This commit is contained in:
Sander Roosendaal
2018-07-23 09:07:25 +02:00
parent 78cc8b86d5
commit e70c477f82
2 changed files with 18 additions and 10 deletions

View File

@@ -9207,7 +9207,12 @@ def workout_stravaimport_view(request,message=""):
start_date = item['start_date']
stravaid = item['id']
if arrow.get(start_date) == arrow.get(w.startdatetime):
if datetime.time(seconds=int(elapsed_time)) == w.duration:
elapsed_td = datetime.timedelta(seconds=int(elapsed_time))
elapsed_time = datetime.datetime.strptime(
str(elapsed_td),
"%H:%M:%S"
)
if str(elapsed_time)[-7:] == str(w.duration)[-7:]:
w.uploadedtostrava = int(stravaid)
w.save()