Be more proactive about presenting the right QRcode image

This commit is contained in:
James Polley 2018-01-13 01:33:26 +11:00
parent 2206f647db
commit 8c0d42ee7f
2 changed files with 7 additions and 6 deletions

View file

@ -1,9 +1,10 @@
<b>Body</b> may include the following variables which will be substituted in the email with a value
specific to each proposal:
<ul>
<li><code>{% templatetag openvariable %} user {% templatetag closevariable %}</code> e.g. {{ sample.user }}
<li><code>{% templatetag openvariable %} qrcode {% templatetag closevariable %}</code> e.g. <code>&lt;img src=&quot;data:image/png;base64,{% templatetag openvariable %} qrcode {% templatetag closevariable %}&quot; /&gt;</code> produces <img src="data:image/png;base64,{{ sample.qrcode }}" />
<li><code>{% templatetag openvariable %} qrcode_url {% templatetag closevariable %}</code> e.g. {{ sample.qrcode_url }}
<li><code>{% templatetag openvariable %} code {% templatetag closevariable %}</code> e.g. {{ sample.code }}
<li><code>{% templatetag openvariable %} user.attendee.ticket_type {% templatetag closevariable %}</code> e.g. {{ sample.user.attendee.ticket_type }}
<li><code>{% templatetag openvariable %} user {% templatetag closevariable %}</code> e.g. {{ sample.user }}</li>
<li><code>{% templatetag openvariable %} qrcode {% templatetag closevariable %}</code> e.g. <code>{% templatetag openvariable %} qrcode|safe {% templatetag closevariable %}</code> produces {{ sample.qrcode|safe }}</li>
<li><code>{% templatetag openvariable %} qrcode_url {% templatetag closevariable %}</code> e.g. {{ sample.qrcode_url }}</li>
<li><code>{% templatetag openvariable %} code {% templatetag closevariable %}</code> e.g. {{ sample.code }}</li>
<li><code>{% templatetag openvariable %} user.attendee.ticket_type {% templatetag closevariable %}</code> e.g. {{ sample.user.attendee.ticket_type }}</li>
<li>The variables <code>invoices</code>, <code>items_pending</code>, <code>items_purchased</code>, <code>categories_missing</code> all return lists of the relevant things</code>
</ul>

View file

@ -118,7 +118,7 @@ def boarding_prepare(request):
"user": sample_checkin.user,
"boardingpass": sample_checkin.boardingpass,
"code": sample_checkin.code,
"qrcode": sample_checkin.qrcode,
"qrcode": '<img src="data:image/png;base64,' + sample_checkin.qrcode + '"/>',
"qrcode_url": request.build_absolute_uri(
reverse("regidesk:checkin_png", args=[sample_checkin.code])),
}