Merge branch 'release/v18.6.23'
This commit is contained in:
@@ -3529,26 +3529,32 @@ class Workout(models.Model):
|
|||||||
workouttype = self.workouttype
|
workouttype = self.workouttype
|
||||||
|
|
||||||
if workouttype != 'water':
|
if workouttype != 'water':
|
||||||
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
|
try:
|
||||||
d=date.strftime('%Y-%m-%d'),
|
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
|
||||||
n=name,
|
d=date.strftime('%Y-%m-%d'),
|
||||||
dist=distance,
|
n=name,
|
||||||
duration=duration.strftime("%H:%M:%S"),
|
dist=distance,
|
||||||
workouttype=workouttype,
|
duration=duration.strftime("%H:%M:%S"),
|
||||||
ownerfirst=ownerfirst,
|
workouttype=workouttype,
|
||||||
ownerlast=ownerlast,
|
ownerfirst=ownerfirst,
|
||||||
)
|
ownerlast=ownerlast,
|
||||||
|
)
|
||||||
|
except ValueError:
|
||||||
|
stri = 'workout'
|
||||||
else:
|
else:
|
||||||
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format(
|
try:
|
||||||
d=date.strftime('%Y-%m-%d'),
|
stri = u'{d} {n} {dist}m {duration} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format(
|
||||||
n=name,
|
d=date.strftime('%Y-%m-%d'),
|
||||||
dist=distance,
|
n=name,
|
||||||
duration=duration,
|
dist=distance,
|
||||||
workouttype=workouttype,
|
duration=duration.strftime("%H:%M:%S"),
|
||||||
boattype=boattype,
|
workouttype=workouttype,
|
||||||
ownerfirst=ownerfirst,
|
boattype=boattype,
|
||||||
ownerlast=ownerlast,
|
ownerfirst=ownerfirst,
|
||||||
)
|
ownerlast=ownerlast,
|
||||||
|
)
|
||||||
|
except ValueError:
|
||||||
|
stri = 'workout'
|
||||||
|
|
||||||
return stri
|
return stri
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ def get_token(code): # pragma: no cover
|
|||||||
response = requests.post(url, auth=HTTPBasicAuth(oauth_data['client_id'], oauth_data['client_secret']),
|
response = requests.post(url, auth=HTTPBasicAuth(oauth_data['client_id'], oauth_data['client_secret']),
|
||||||
data=post_data)
|
data=post_data)
|
||||||
|
|
||||||
|
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return [0, response.text, 0, 0]
|
return [0, response.text, 0, 0]
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ class AsyncTaskTests(TestCase):
|
|||||||
userfirstname = self.u.first_name
|
userfirstname = self.u.first_name
|
||||||
userlastname = self.u.last_name,
|
userlastname = self.u.last_name,
|
||||||
rowerfirstname = self.u.first_name,
|
rowerfirstname = self.u.first_name,
|
||||||
|
rowerlastname = self.u.last_name,
|
||||||
alertname = 'Test Alert'
|
alertname = 'Test Alert'
|
||||||
stats = {
|
stats = {
|
||||||
'percentage': 45,
|
'percentage': 45,
|
||||||
@@ -234,7 +235,8 @@ class AsyncTaskTests(TestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = tasks.handle_send_email_alert(useremail,userfirstname,userlastname,
|
res = tasks.handle_send_email_alert(useremail,userfirstname,userlastname,
|
||||||
rowerfirstname,alertname,stats)
|
rowerfirstname,
|
||||||
|
rowerlastname,alertname,stats)
|
||||||
|
|
||||||
self.assertEqual(res,1)
|
self.assertEqual(res,1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user