Skip to content
Snippets Groups Projects

name changes: kit -> sample

Merged Piotr Gawron requested to merge 81-email-to-technician into master
1 file
+ 6
5
Compare changes
  • Side-by-side
  • Inline
+ 6
5
@@ -82,14 +82,14 @@ def send_mail(data):
end_date_str = " end of time"
if data["end_date"] is not None:
end_date_str = data["end_date"].strftime('%Y-%m-%d')
title = "Kits required between " + data["start_date"].strftime('%Y-%m-%d') + " and " + end_date_str
title = "Samples between " + data["start_date"].strftime('%Y-%m-%d') + " and " + end_date_str
cell_style = "padding: 8px; line-height: 1.42857143; vertical-align: top; " \
"font-size: 14px; font-family: 'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;"
email_body = "<h1>" + title + "</h1>"
email_body += '<table style="border: 1px solid #f4f4f4;border-spacing: 0;border-collapse: collapse;">' \
'<thead><tr><th>Date</th><th>Kits</th><th>Location</th><th>Person responsible</th></tr></thead>'
'<thead><tr><th>Date</th><th>Samples</th><th>Location</th><th>Person responsible</th></tr></thead>'
email_body += "<tbody>"
even = True
@@ -106,7 +106,10 @@ def send_mail(data):
if item.disposable:
email_body += item.name + ", "
email_body += "</td>"
email_body += "<td style='" + cell_style + "'>" + str(appointment.location) + "</td>"
location = str(appointment.location)
if appointment.flying_team is not None:
location += " (" + str(appointment.flying_team) + ")"
email_body += "<td style='" + cell_style + "'>" + location + "</td>"
email_body += "<td style='" + cell_style + "'>" + str(appointment.worker_assigned) + "</td>"
email_body += "</tr>"
email_body += "</tbody></table>"
@@ -143,8 +146,6 @@ class KitRequestEmailSendJob(CronJobBase):
jobs = CronJobLog.objects.filter(code=KitRequestEmailSendJob.code, message="mail sent", start_time__gte=date)
if jobs.count() == 0:
print date
print datetime.datetime.now()
if pytz.utc.localize(datetime.datetime.utcnow()) > date:
if self.match_day_of_week():
data = get_kit_requests(Worker.objects.create());
Loading