Private
Public Access
1
0

through emails now

This commit is contained in:
Sander Roosendaal
2018-06-28 15:31:21 +02:00
parent 6acb5d9f49
commit 35b71c0b63
4 changed files with 29 additions and 29 deletions

View File

@@ -98,6 +98,17 @@ def matchsync(line):
return results
def getstravaid(uploadoptions,body):
stravaid = 0
tester = re.compile('^(stravaid)(.*?)(\d+)')
for line in body.splitlines():
if tester.match(line.lower()):
stravaid = tester.match(line.lower()).group(3)
uploadoptions['stravaid'] = int(stravaid)
return uploadoptions
def gettypeoptions_body2(uploadoptions,body):
tester = re.compile('^(workout)')
testerb = re.compile('^(boat)')
@@ -272,6 +283,7 @@ def upload_options(body):
uploadoptions = getsyncoptions_body2(uploadoptions,body)
uploadoptions = getprivateoptions_body2(uploadoptions,body)
typeoptions = gettypeoptions_body2(uploadoptions,body)
uploadoptions = getstravaid(uploadoptions,body)
except IOError:
pm = exc.problem_mark
strpm = str(pm)
@@ -375,7 +387,14 @@ def make_private(w,options):
from rowers.utils import isprorower
def do_sync(w,options):
def do_sync(w,options):
try:
if options['stravaid'] != 0:
w.uploadedtostrava = stravaid
w.save()
except KeyError:
pass
if ('upload_to_C2' in options and options['upload_to_C2']) or (w.user.c2_auto_export and isprorower(w.user)):
try:
message,id = c2stuff.workout_c2_upload(w.user.user,w)