diff options
| author | Xavier Morel <xmo@odoo.com> | 2020-09-09 13:47:11 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2020-09-09 13:47:11 +0000 |
| commit | e10cbc792f8f6432f8ee5d8065cd4a123f2a4754 (patch) | |
| tree | 45e8500eb814836fd79ae0c819e84dea58824700 /addons/auth_totp/models/res_users.py | |
| parent | 4f1b6a0a8fd8778975c24d53693cdfb5c7724f93 (diff) | |
[IMP] auth_totp: import qrcode lazily
fp request
closes odoo/odoo#57363
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons/auth_totp/models/res_users.py')
| -rw-r--r-- | addons/auth_totp/models/res_users.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/auth_totp/models/res_users.py b/addons/auth_totp/models/res_users.py index bb703e3ee77..855a92e0f35 100644 --- a/addons/auth_totp/models/res_users.py +++ b/addons/auth_totp/models/res_users.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import base64 -import hashlib import hmac import io import logging @@ -8,7 +7,6 @@ import os import struct import time -import qrcode import werkzeug.urls from odoo import _, api, fields, models @@ -146,6 +144,7 @@ class TOTPWizard(models.TransientModel): )) data = io.BytesIO() + import qrcode qrcode.make(url.encode(), box_size=4).save(data, optimise=True, format='PNG') w.qrcode = base64.b64encode(data.getvalue()).decode() |
