Fix scanning stuff.

This commit is contained in:
Víðir Valberg Guðmundsson 2019-08-08 13:06:24 +02:00
parent 470115a0d9
commit 9dd6b0b23c
3 changed files with 5 additions and 5 deletions

View file

@ -16,10 +16,10 @@ document.addEventListener("DOMContentLoaded", () => {
if (ticket_token_input.value === "#clear") {
window.location.replace(window.location.pathname);
} else if (ticket_token_input.value === "#check-in") {
} else if (ticket_token_input.value === "#checkin") {
check_in_input.checked = true;
check_in_form.submit();
} else if (ticket_token_input.value === "#hand-out-badge") {
} else if (ticket_token_input.value === "#handoutbadge") {
hand_out_badge_input.checked = true;
check_in_form.submit();
} else if (ticket_token_input.value.length === 65) {

View file

@ -97,13 +97,13 @@
{% if not ticket.used %}
<div class="col-md-4">
{% qr_code "check-in" %}
{% qr_code "checkin" %}
</div>
{% endif %}
{% if ticket.ticket_type.includes_badge and not ticket.badge_handed_out %}
<div class="col-md-4">
{% qr_code "hand-out-badge" %}
{% qr_code "handoutbadge" %}
</div>
{% endif %}
</div>

View file

@ -11,7 +11,7 @@ register = template.Library()
@register.simple_tag
def qr_code(value):
stream = io.BytesIO()
img = qrcode.make("#" + value, box_size=7)
img = qrcode.make(value, box_size=7)
img.save(stream, "PNG")
data = base64.b64encode(stream.getvalue())