- commit
- d94d43463c47db18c840c9356529f5b5ccfcd7f4
- parent
- a35618c6ed2d450df0fc6dfdc7b56598f581f06e
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-02-27 15:43
use qrcode to_string()
Diffstat
| M | mfa/templatetags/mfa.py | 6 | +----- |
| M | setup.py | 2 | +- |
2 files changed, 2 insertions, 6 deletions
diff --git a/mfa/templatetags/mfa.py b/mfa/templatetags/mfa.py
@@ -1,5 +1,3 @@1 -1 from io import BytesIO2 -13 1 import qrcode 4 2 import qrcode.image.svg 5 3 from django import template @@ -10,9 +8,7 @@ register = template.Library() 10 8 11 9 @register.filter(name='qrcode') 12 10 def get_qrcode(url):13 -1 buf = BytesIO()14 11 img = qrcode.make(url, image_factory=qrcode.image.svg.SvgImage)15 -1 img.save(buf)16 -1 s = buf.getvalue().decode('utf-8')-1 12 s = img.to_string().decode('utf-8') 17 13 i = s.find('<svg') 18 14 return mark_safe(s[i:])
diff --git a/setup.py b/setup.py
@@ -17,7 +17,7 @@ setup( 17 17 'pyotp', 18 18 'fido2>=1.0.0', 19 19 # https://github.com/lincolnloop/python-qrcode/issues/31720 -1 'qrcode<7.4',-1 20 'qrcode>=7.1,<7.4', 21 21 'django>=2.2', 22 22 ], 23 23 classifiers=[