Private
Public Access
1
0

notifications suppressed & some strava checking

This commit is contained in:
Sander Roosendaal
2018-07-12 12:39:10 +02:00
parent 1ada144b8e
commit 80623af8c5
4 changed files with 51 additions and 11 deletions

View File

@@ -9189,6 +9189,25 @@ def workout_stravaimport_view(request,message=""):
workouts = []
r = getrower(request.user)
stravaids = [int(item['id']) for item in res.json()]
stravadata = [{
'id':int(item['id']),
'elapsed_time':item['elapsed_time'],
'start_date':item['start_date'],
} for item in res.json()]
wfailed = Workout.objects.filter(user=rower,uploadedtostrava=-1)
for w in wfailed:
for item in stravadata:
elapsed_time = item['elapsed_time']
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:
w.uploadedtostrava = int(stravaid)
w.save()
knownstravaids = uniqify([
w.uploadedtostrava for w in Workout.objects.filter(user=r)
])