diff --git a/smash/web/views/kit.py b/smash/web/views/kit.py index 40be62c73df5073515a8ca4564f0da3b04e20ba0..79c42ef5fb89430026ceaa05c20e766f7175e7ca 100644 --- a/smash/web/views/kit.py +++ b/smash/web/views/kit.py @@ -110,8 +110,11 @@ def send_mail(data): email_body += "<tr style='" + row_style + "'>" email_body += "<td style='" + cell_style + "'>" + \ appointment.datetime_when.strftime('%Y-%m-%d %H:%M') + "</td>" - email_body += "<td style='" + cell_style + "'>" + \ - appointment.visit.subject.nd_number + "</td>" + if appointment.visit is not None and appointment.visit.subject is not None: + email_body += "<td style='" + cell_style + "'>" + \ + appointment.visit.subject.nd_number + "</td>" + else: + email_body += "<td style='" + cell_style + "'>" + '-' + "</td>" email_body += "<td style='" + cell_style + "'>" for type in appointment.appointment_types.all(): for item in type.required_equipment.all():