diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 8b32ff78..b6f3124d 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -1003,13 +1003,14 @@ def checkbreakthrough(w, r): r.user.last_name, btvalues=btvalues.to_json()) for coach in r.get_coaches(): - _ = myqueue(queuehigh, handle_sendemail_breakthrough, - w.id, - coach.user.email, - r.user.first_name, - r.user.last_name, - btvalues=btvalues.to_json(), - surname=True) + if coach.getemailnotifications and not coach.emailbounced: + _ = myqueue(queuehigh, handle_sendemail_breakthrough, + w.id, + coach.user.email, + r.user.first_name, + r.user.last_name, + btvalues=btvalues.to_json(), + surname=True) # submit email task to send email about breakthrough workout if ishard: # pragma: no cover @@ -1024,13 +1025,14 @@ def checkbreakthrough(w, r): r.user.last_name, btvalues=btvalues.to_json()) for coach in r.get_coaches(): - _ = myqueue(queuehigh, handle_sendemail_hard, - w.id, - coach.user.email, - r.user.first_name, - r.user.last_name, - btvalues=btvalues.to_json(), - surname=True) + if coach.getemailnotifications and not coach.emailbounced: + _ = myqueue(queuehigh, handle_sendemail_hard, + w.id, + coach.user.email, + r.user.first_name, + r.user.last_name, + btvalues=btvalues.to_json(), + surname=True) return isbreakthrough, ishard diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index cc86876b..cf7151b4 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -5783,7 +5783,7 @@ def interactive_flex_chart2(id, r, promember=0, workstrokesonly = False try: _ = rowdata[yparam2] - except KeyError: # pragma: no cover + except (KeyError, TypeError): # pragma: no cover yparam2 = 'None' try: diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index 477c2a27..f64f8531 100644 Binary files a/rowers/tests/testdata/testdata.tcx.gz and b/rowers/tests/testdata/testdata.tcx.gz differ diff --git a/rowers/utils.py b/rowers/utils.py index 7572d7f5..de07d4f7 100644 --- a/rowers/utils.py +++ b/rowers/utils.py @@ -326,7 +326,7 @@ def isbreakthrough(delta, cpvalues, p0, p1, p2, p3, ratio): cpvalues = cpvalues.values.astype(int) pwr = pwr.astype(int) - res = np.sum(cpvalues > pwr) + res = np.sum(cpvalues > pwr+1) res2 = np.sum(cpvalues > pwr2) btdf = pd.DataFrame(