Private
Public Access
1
0

get dates timeperiod updates to work better with local time zones

This commit is contained in:
Sander Roosendaal
2021-09-21 11:04:36 +02:00
parent 8205fd3c3f
commit 5b11413068
8 changed files with 170 additions and 27 deletions

View File

@@ -512,6 +512,9 @@ def rower_process_nkcallback(request): # pragma: no cover
@login_required()
def workout_getnkworkout_all(request,startdatestring='',enddatestring=''):
startdate,enddate = get_dates_timeperiod(request,startdatestring=startdatestring,enddatestring=enddatestring)
startdate = startdate.date()
enddate = enddate.date()
before = arrow.get(enddate)
before = str(int(before.timestamp()*1000))
@@ -540,6 +543,8 @@ def workout_getnkworkout_all(request,startdatestring='',enddatestring=''):
@permission_required('rower.is_not_freecoach',fn=get_user_by_userid, raise_exception=True)
def workout_nkimport_view(request,userid=0,after=0,before=0):
startdate,enddate = get_dates_timeperiod(request,defaulttimeperiod='last30')
startdate = startdate.date()
enddate = enddate.date()
r = getrequestrower(request,userid=userid)
if r.user != request.user: # pragma: no cover
messages.error(request,'You can only access your own workouts on the NK Logbook, not those of your athletes')