strava working
This commit is contained in:
@@ -18,7 +18,7 @@ from stravalib.exc import ActivityUploadFailed,TimeoutExceeded
|
||||
from iso8601 import ParseError
|
||||
from utils import myqueue
|
||||
|
||||
|
||||
import mytypes
|
||||
import gzip
|
||||
|
||||
from rowsandall_app.settings import (
|
||||
@@ -163,7 +163,7 @@ def create_async_workout(alldata,user,stravaid,debug=False):
|
||||
distance = data['distance']
|
||||
stravaid = data['id']
|
||||
try:
|
||||
workouttype = data['type']
|
||||
workouttype = mytypes.stravamappinginv[data['type']]
|
||||
except:
|
||||
workouttype = 'rower'
|
||||
|
||||
@@ -444,14 +444,15 @@ def add_workout_from_data(user,importid,data,strokedata,
|
||||
source='strava',splitdata=None,
|
||||
workoutsource='strava'):
|
||||
try:
|
||||
workouttype = data['type']
|
||||
workouttype = mytypes.stravamappinginv[data['type']]
|
||||
except KeyError:
|
||||
workouttype = 'rower'
|
||||
|
||||
if workouttype.lower() == 'rowing':
|
||||
workouttype = 'rower'
|
||||
if 'summary_polyline' in data['map']:
|
||||
workouttype = 'water'
|
||||
|
||||
if 'summary_polyline' in data['map'] and workouttype=='rower':
|
||||
workouttype = 'water'
|
||||
|
||||
if workouttype not in [x[0] for x in Workout.workouttypes]:
|
||||
workouttype = 'other'
|
||||
|
||||
Reference in New Issue
Block a user