From d5ce50ddcc1c5522a40f5eb3d9d357b434835991 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 16 Mar 2021 12:59:45 +0100 Subject: [PATCH] fixes in c2_auto_export --- requirements.txt | 5 +++-- rowers/uploads.py | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 674068c8..aa3c7d71 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ apipkg==1.5 appdirs==1.4.3 arcgis==1.6.0 arrow==1.0.2 +asgiref==3.3.1 asn1crypto==0.24.0 atomicwrites==1.3.0 attrs==19.1.0 @@ -12,8 +13,8 @@ billiard==3.6.0.0 bleach==3.1.0 bokeh==2.2.3 boto==2.49.0 -boto3==1.17.12 -botocore==1.20.12 +boto3==1.17.28 +botocore==1.20.28 bottle==0.12.18 braintree==3.55.0 cairocffi==1.0.2 diff --git a/rowers/uploads.py b/rowers/uploads.py index 33edb2e9..d72a118d 100644 --- a/rowers/uploads.py +++ b/rowers/uploads.py @@ -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,