sporttracks, not fully tested
This commit is contained in:
@@ -2,7 +2,6 @@ from rowers.mytypes import workouttypes, boattypes, otwtypes, workoutsources, wo
|
||||
|
||||
from rowers.rower_rules import is_promember
|
||||
import rowers.tpstuff as tpstuff
|
||||
import rowers.sporttracksstuff as sporttracksstuff
|
||||
|
||||
from rowers.integrations import *
|
||||
from rowers.utils import (
|
||||
@@ -131,7 +130,6 @@ def make_plot(r, w, f1, f2, plottype, title, imagename='', plotnr=0):
|
||||
|
||||
|
||||
def do_sync(w, options, quick=False):
|
||||
|
||||
do_strava_export = w.user.strava_auto_export
|
||||
try:
|
||||
do_strava_export = options['upload_to_Strava'] or do_strava_export
|
||||
@@ -236,8 +234,10 @@ def do_sync(w, options, quick=False):
|
||||
f.write(str(e))
|
||||
|
||||
do_st_export = w.user.sporttracks_auto_export
|
||||
|
||||
if options['sporttracksid'] != 0 and options['sporttracksid'] != '':
|
||||
w.uploadedtost = options['sporttracksid']
|
||||
w.uploadedtosporttracks = options['sporttracksid']
|
||||
|
||||
w.save()
|
||||
do_st_export = False
|
||||
try: # pragma: no cover
|
||||
@@ -248,9 +248,9 @@ def do_sync(w, options, quick=False):
|
||||
|
||||
if do_st_export: # pragma: no cover
|
||||
try:
|
||||
message, id = sporttracksstuff.workout_sporttracks_upload(
|
||||
w.user.user, w, asynchron=True,
|
||||
)
|
||||
st_integration = SportTracksIntegration(w.user.user)
|
||||
id = st_integration.workout_export(w)
|
||||
|
||||
dologging('st_export.log',
|
||||
'exported workout {wid} for user {uid}'.format(
|
||||
wid = w.id,
|
||||
|
||||
Reference in New Issue
Block a user