Skip to content
Snippets Groups Projects
Commit 286d0f70 authored by Carlos Vega's avatar Carlos Vega
Browse files

Issue #259 check if the appointment has visit or subject

parent 8c17e2d5
No related branches found
No related tags found
1 merge request!176Bug/kit request mail crash
Pipeline #7157 passed
...@@ -110,8 +110,11 @@ def send_mail(data): ...@@ -110,8 +110,11 @@ def send_mail(data):
email_body += "<tr style='" + row_style + "'>" email_body += "<tr style='" + row_style + "'>"
email_body += "<td style='" + cell_style + "'>" + \ email_body += "<td style='" + cell_style + "'>" + \
appointment.datetime_when.strftime('%Y-%m-%d %H:%M') + "</td>" appointment.datetime_when.strftime('%Y-%m-%d %H:%M') + "</td>"
email_body += "<td style='" + cell_style + "'>" + \ if appointment.visit is not None and appointment.visit.subject is not None:
appointment.visit.subject.nd_number + "</td>" 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 + "'>" email_body += "<td style='" + cell_style + "'>"
for type in appointment.appointment_types.all(): for type in appointment.appointment_types.all():
for item in type.required_equipment.all(): for item in type.required_equipment.all():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment