Private
Public Access
1
0

Merge branch 'release/v18.9.15'

This commit is contained in:
Sander Roosendaal
2023-02-01 19:13:15 +01:00
4 changed files with 20 additions and 7 deletions

View File

@@ -682,8 +682,11 @@ def createc2workoutdata(w):
w.timezone = 'UTC'
w.save()
wendtime = w.startdatetime.astimezone(pytz.timezone(
w.timezone))+datetime.timedelta(seconds=makeseconds(durationstr))
try:
wendtime = w.startdatetime.astimezone(pytz.timezone(
w.timezone))+datetime.timedelta(seconds=makeseconds(durationstr))
except UnknownTimeZoneError:
wendtime = w.startdatetime+datetime.timedelta(seconds=makeseconds(durationstr))
data = {
"type": mytypes.c2mapping[workouttype],

View File

@@ -876,9 +876,10 @@ def checkduplicates(r, workoutdate, workoutstartdatetime, workoutenddatetime):
t = ww.duration
delta = datetime.timedelta(
hours=t.hour, minutes=t.minute, seconds=t.second)
enddatetime = ww.startdatetime+delta
if enddatetime > workoutstartdatetime:
ws2.append(ww)
if ww.startdatetime is not None:
enddatetime = ww.startdatetime+delta
if enddatetime > workoutstartdatetime:
ws2.append(ww)
if (len(ws2) != 0):
duplicate = True

View File

@@ -271,6 +271,13 @@ def strokedatajson_v3(request):
startdatetime = pendulum.parse(startdatetime)
dologging('apilog.log',workouttype)
dologging('apilog.log',boattype)
dologging('apilog.log',notes)
dologging('apilog.log',title)
dologging('apilog.log',totalDistance)
dologging('apilog.log',elapsedTime)
df = pd.DataFrame()
try:
strokes = request.data['strokes']
@@ -298,7 +305,10 @@ def strokedatajson_v3(request):
_ = data.to_csv(csvfilename, index_label='index', compression='gzip')
duration = datetime.time(0,0,1)
w = Workout(user=request.user.rower,date=timezone.now().date(),duration=duration)
w = Workout(
user=request.user.rower,
date=timezone.now().date(),
duration=duration)
w.save()
uploadoptions = {

View File

@@ -5211,7 +5211,6 @@ def workout_upload_api(request):
# sync related IDs
c2id = post_data.get('c2id', '')
workoutid = post_data.get('id','')
startdatetime = post_data.get('startdatetime', '')
oarlockfirmware = post_data.get('oarlockfirmware', None)
inboard = post_data.get('inboard', None)