strip space in qrcode

This commit is contained in:
virusdefender 2018-04-25 21:26:32 +08:00
parent 443fc22699
commit 5cb907fa94

View File

@ -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