Switch to png as a plain boring attachment

In the body of the email, we can load the image direct from the
site. Prolly gonna fail a lot but at least it's a loud known visible
failure
This commit is contained in:
James Polley 2018-01-15 08:20:24 +11:00
parent 018f7bef7a
commit 6770e83e5d

View file

@ -201,7 +201,7 @@ def boarding_send(request):
"user": user,
"checkin": user.checkin,
"code": user.checkin.code,
"qrcode": '<img src="cid:qrcode.png"/>',
"qrcode": user.checkin.qrcode,
"qrcode_url": request.build_absolute_uri(
reverse("regidesk:checkin_png", args=[user.checkin.code])),
}
@ -241,9 +241,7 @@ def boarding_send(request):
if bpass.html_body:
msg.attach_alternative(bpass.html_body, "text/html")
qrcode_image = MIMEImage(base64.b64decode(user.checkin.qrcode))
qrcode_image.add_header('Content-ID', '<qrcode.png>')
msg.attach(qrcode_image)
msg.attach(filename="qrcode.png", content=user.checkin.qrcode, mimetype="image/png")
if user in boarding_users:
with transaction.atomic():