Merge branch 'release/v16.4.18'
This commit is contained in:
@@ -700,6 +700,10 @@ def createc2workoutdata(w):
|
|||||||
if workouttype in otwtypes:
|
if workouttype in otwtypes:
|
||||||
workouttype = 'water'
|
workouttype = 'water'
|
||||||
|
|
||||||
|
if w.timezone == 'tzutc()':
|
||||||
|
w.timezone = 'UTC'
|
||||||
|
w.save()
|
||||||
|
|
||||||
|
|
||||||
wendtime = w.startdatetime.astimezone(pytz.timezone(w.timezone))+datetime.timedelta(seconds=makeseconds(durationstr))
|
wendtime = w.startdatetime.astimezone(pytz.timezone(w.timezone))+datetime.timedelta(seconds=makeseconds(durationstr))
|
||||||
|
|
||||||
|
|||||||
@@ -3236,6 +3236,9 @@ class Workout(models.Model):
|
|||||||
if not can_add_workout(user.user):
|
if not can_add_workout(user.user):
|
||||||
raise forms.ValidationError("Free Coach User cannot have any workouts")
|
raise forms.ValidationError("Free Coach User cannot have any workouts")
|
||||||
|
|
||||||
|
if self.timezone == 'tzutc()':
|
||||||
|
self.timezone = 'UTC'
|
||||||
|
|
||||||
super(Workout, self).save(*args, **kwargs)
|
super(Workout, self).save(*args, **kwargs)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|||||||
@@ -266,3 +266,26 @@ def strokeDataToDf(strokeData):
|
|||||||
|
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
def readlogs_summaries(logfile): # pragma: no cover
|
||||||
|
with open(logfile,'r') as f:
|
||||||
|
while f:
|
||||||
|
s = f.readline()
|
||||||
|
if s == "":
|
||||||
|
break
|
||||||
|
if "Importing" in s:
|
||||||
|
words = s.split(" ")
|
||||||
|
nkid = words[-1]
|
||||||
|
print(nkid)
|
||||||
|
line1 = f.readline()
|
||||||
|
line2 = f.readline()
|
||||||
|
|
||||||
|
data1 = line1[line1.find('{'):]
|
||||||
|
data2 = line2[line2.find('['):]
|
||||||
|
|
||||||
|
strokeData = json.loads(data2)
|
||||||
|
summaryData = json.loads(data1)
|
||||||
|
|
||||||
|
df = strokeDataToDf(strokeData)
|
||||||
|
|
||||||
|
print(get_nk_allstats(summaryData,df))
|
||||||
|
|||||||
Reference in New Issue
Block a user