Skip to content
Snippets Groups Projects
Commit 8046699f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '81-email-to-technician' into 'master'

name changes: kit -> sample

Closes #81

See merge request !51
parents 848e681a c679ced9
No related branches found
No related tags found
1 merge request!51name changes: kit -> sample
Pipeline #
......@@ -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());
......
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