High dose alert e-mails are not sent if DAP alert exceeded and skin dose alert switched on

Issue #1012 new
David Platten created an issue

This code snippet from rdsr.py means that a DAP alert level can be exceeded, but no alert message is sent.

Note that send_alert_emails_ref is a switch for DAP and dose at reference point message sending.

# Send an e-mail to all high dose alert recipients if this study is at or above threshold levels
send_alert_emails_ref = HighDoseMetricAlertSettings.objects.values_list(
    "send_high_dose_metric_alert_emails_ref", flat=True
)[0]
send_alert_emails_skin = HighDoseMetricAlertSettings.objects.values_list(
    "send_high_dose_metric_alert_emails_skin", flat=True
)[0]
if send_alert_emails_ref and not send_alert_emails_skin:
    send_rf_high_dose_alert_email(g.pk)

I think the last two lines should be changed to:

if send_alert_emails_ref:
    send_rf_high_dose_alert_email(g.pk)

This will ensure users are e-mailed an alert message if DAP or reference point dose is exceeded. OpenREM may then go on to calculate a skin dose map. If the peak skin dose is above its alert level then the users may then get a second alert level based on the peak skin dose.