From 5cb907fa9481c12c361afb6708ac5de439ad4cec Mon Sep 17 00:00:00 2001 From: virusdefender Date: Wed, 25 Apr 2018 21:26:32 +0800 Subject: [PATCH] strip space in qrcode --- account/views/oj.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account/views/oj.py b/account/views/oj.py index d6783e3a..99051ae5 100644 --- a/account/views/oj.py +++ b/account/views/oj.py @@ -102,7 +102,7 @@ class TwoFactorAuthAPI(APIView): user.save() label = f"{SysOptions.website_name_shortcut}:{user.username}" - image = qrcode.make(OtpAuth(token).to_uri("totp", label, SysOptions.website_name)) + image = qrcode.make(OtpAuth(token).to_uri("totp", label, SysOptions.website_name.replace(" ", ""))) return self.success(img2base64(image)) @login_required