Specify PNG image for QR code generation

This commit is contained in:
Oliver Walters 2019-09-06 12:38:09 +10:00
parent 4ff7920296
commit eb378e5e5d
3 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,14 @@
.qr-code {
max-width: 400px;
max-height: 400px;
align-content: center;
}
.qr-container {
width: 100%;
align-content: center;
}
.navbar-brand {
float: left;
}

View File

@ -78,7 +78,7 @@ class TestQuoteWrap(TestCase):
self.assertEqual(helpers.WrapWithQuotes('hello"'), '"hello"')
class TestMakeBarcoede(TestCase):
class TestMakeBarcode(TestCase):
""" Tests for barcode string creation """
def test_barcode(self):

View File

@ -2,7 +2,9 @@
<div class='container' style='width: 80%;'>
{% if qr_data %}
<img src="{% qr_url_from_text qr_data size='m' error_correction='q' %}" alt="QR Code">
<div class='qr-container'>
<img class='qr-code' src="{% qr_url_from_text qr_data size='m' image_format='png' error_correction='q' %}" alt="QR Code">
</div>
{% else %}
<b>Error:</b><br>
{{ error_msg }}