some bug fixes
This commit is contained in:
@@ -791,14 +791,33 @@ def handle_send_email_alert(
|
||||
othertexts = None
|
||||
|
||||
report = {}
|
||||
report['Percentage'] = int(stats['percentage'])
|
||||
report['Number of workouts'] = int(stats['workouts'])
|
||||
report['Data set'] = "{a} strokes out of {b}".format(
|
||||
try:
|
||||
report['Percentage'] = int(stats['percentage'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
report['Number of workouts'] = int(stats['workouts'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
report['Data set'] = "{a} strokes out of {b}".format(
|
||||
a = stats['nr_strokes_qualifying'],
|
||||
b = stats['nr_strokes']
|
||||
)
|
||||
report['Median'] = sigdig(stats['median'])
|
||||
report['Median of qualifying strokes'] = sigdig(stats['median_q'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
report['Median'] = sigdig(stats['median'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
report['Median of qualifying strokes'] = sigdig(stats['median_q'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
subject = "Rowsandall.com: {alertname} ({startdate} to {enddate})".format(
|
||||
startdate = stats['startdate'],
|
||||
|
||||
Reference in New Issue
Block a user