Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2021-05-01 16:14:23 +02:00
parent 0fa4c78e53
commit 3debaf7973
4 changed files with 5 additions and 5 deletions

View File

@@ -221,10 +221,10 @@ def get_nk_workout_list(user,fake=False,after=0,before=0):
return custom_exception_handler(401,s)
else:
# ready to fetch. Hurray
if not before:
if not before: # pragma: no cover
before = arrow.now()+timedelta(days=1)
before = str(int(before.timestamp())*1000)
if not after:
if not after: # pragma: no cover
after = arrow.now()-timedelta(days=7)
after = str(int(after.timestamp())*1000)
authorizationstring = str('Bearer ' + r.nktoken)

View File

@@ -622,7 +622,7 @@ def do_sync(w,options, quick=False):
do_tp_export = w.user.trainingpeaks_auto_export
try:
try: # pragma: no cover
upload_to_tp = options['upload_to_SportTracks'] or do_tp_export
do_tp_export = upload_to_tp
except KeyError:

View File

@@ -2266,7 +2266,7 @@ def history_view(request,userid=0):
lastyear = datetime.datetime(year=today.year-1,month=today.month,day=today.day)
firstmay = datetime.datetime(year=today.year,month=5,day=1).astimezone(usertimezone)
if firstmay>today:
if firstmay>today: # pragma: no cover
firstmay = datetime.datetime(year=today.year-1,month=5,day=1)

View File

@@ -853,7 +853,7 @@ def workout_nkimport_view(request,userid=0,after=0,before=0):
except NoTokenError: # pragma: no cover
return HttpResponseRedirect("/rowers/me/nkauthorize/")
if request.method == 'POST':
if request.method == 'POST': # pragma: no cover
dateform = DateRangeForm(request.POST)
if dateform.is_valid():
startdate = dateform.cleaned_data['startdate']