From eb378e5e5d08c48f0fa0f97b53d6ddc1dde6f549 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 6 Sep 2019 12:38:09 +1000 Subject: [PATCH] Specify PNG image for QR code generation --- InvenTree/InvenTree/static/css/inventree.css | 11 +++++++++++ InvenTree/InvenTree/tests.py | 2 +- InvenTree/templates/qr_code.html | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index d9515dbff9..321d9e1cf4 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -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; } diff --git a/InvenTree/InvenTree/tests.py b/InvenTree/InvenTree/tests.py index 2d1b345687..4e238a6c80 100644 --- a/InvenTree/InvenTree/tests.py +++ b/InvenTree/InvenTree/tests.py @@ -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): diff --git a/InvenTree/templates/qr_code.html b/InvenTree/templates/qr_code.html index 9c0c698368..bdc58a45eb 100644 --- a/InvenTree/templates/qr_code.html +++ b/InvenTree/templates/qr_code.html @@ -2,7 +2,9 @@
{% if qr_data %} - QR Code +
+ QR Code +
{% else %} Error:
{{ error_msg }}