Decode the image so it can be re-encoded

#sigh
This commit is contained in:
James Polley 2018-01-19 08:05:54 +11:00
parent 5a6759adae
commit e120f7a691

View file

@ -240,7 +240,8 @@ def send_boarding_pass(bpass, user):
msg.mixed_subtype="related"
if bpass.html_body:
msg.attach_alternative(bpass.html_body, "text/html")
msg.attach(filename="qrcode.png", content=user.checkin.qrcode, mimetype="image/png")
qrcode = base64.b64decode(user.checkin.qrcode)
msg.attach(filename="qrcode.png", content=qrcode, mimetype="image/png")
msg.send()
bpass.sent = datetime.now()