fixes in c2_auto_export
This commit is contained in:
@@ -526,8 +526,9 @@ def make_private(w,options):
|
||||
|
||||
def do_sync(w,options, quick=False):
|
||||
|
||||
do_strava_export = w.user.strava_auto_export
|
||||
try:
|
||||
upload_to_strava = options['upload_to_Strava']
|
||||
upload_to_strava = options['upload_to_Strava'] or do_strava_export
|
||||
except KeyError:
|
||||
upload_to_strava = False
|
||||
|
||||
@@ -535,6 +536,7 @@ def do_sync(w,options, quick=False):
|
||||
if options['stravaid'] != 0 and options['stravaid'] != '':
|
||||
w.uploadedtostrava = options['stravaid']
|
||||
upload_to_strava = False
|
||||
do_strava_export = False
|
||||
w.save()
|
||||
except KeyError:
|
||||
pass
|
||||
@@ -546,9 +548,9 @@ def do_sync(w,options, quick=False):
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
do_c2_export = w.user.c2_auto_export
|
||||
try:
|
||||
upload_to_c2 = options['upload_to_C2']
|
||||
upload_to_c2 = options['upload_to_C2'] or do_c2_export
|
||||
except KeyError:
|
||||
upload_to_c2 = False
|
||||
|
||||
@@ -556,6 +558,7 @@ def do_sync(w,options, quick=False):
|
||||
if options['c2id'] != 0 and options['c2id'] != '':
|
||||
w.uploadedtoc2 = options['c2id']
|
||||
upload_to_c2 = False
|
||||
do_c3_export = False
|
||||
w.save()
|
||||
except KeyError:
|
||||
pass
|
||||
@@ -570,7 +573,7 @@ def do_sync(w,options, quick=False):
|
||||
if w.duplicate:
|
||||
return 0
|
||||
|
||||
if ('upload_to_C2' in options and upload_to_c2) or (w.user.c2_auto_export):
|
||||
if do_c2_export:
|
||||
try:
|
||||
message,id = c2stuff.workout_c2_upload(w.user.user,w,asynchron=True)
|
||||
except NoTokenError:
|
||||
@@ -579,7 +582,7 @@ def do_sync(w,options, quick=False):
|
||||
except:
|
||||
pass
|
||||
|
||||
if ('upload_to_Strava' in options and upload_to_strava) or (w.user.strava_auto_export):
|
||||
if do_strava_export:
|
||||
try:
|
||||
message,id = stravastuff.workout_strava_upload(
|
||||
w.user.user,w,quick=quick,asynchron=True,
|
||||
|
||||
Reference in New Issue
Block a user