OCA / server-tools

Tools for Odoo Administrators to improve some technical features on Odoo.
https://odoo-community.org/psc-teams/tools-30
GNU Affero General Public License v3.0
680 stars 1.47k forks source link

[10.0] auth_totp fail with accents #2017

Open syci opened 3 years ago

syci commented 3 years ago

In the next line of code, with a name with accents, the generation of the QR fails

https://github.com/OCA/server-tools/blob/1c5d6bbbd78386d8a946edb3a68416ef557d3319/auth_totp/wizards/res_users_authenticator_create.py#L78

  File "/home/odoo/odoo/OCA/server-tools/auth_totp/wizards/res_users_authenticator_create.py", line 78, in _compute_qr_code_tag
    issuer_name=record.user_id.company_id.display_name,
  File "/usr/local/lib/python2.7/dist-packages/pyotp/totp.py", line 88, in provisioning_uri
    digits=self.digits, period=self.interval)
  File "/usr/local/lib/python2.7/dist-packages/pyotp/utils.py", line 63, in build_uri
    label = quote(issuer_name) + ':' + label
  File "/usr/lib/python2.7/urllib.py", line 1300, in quote
    return ''.join(map(quoter, s))
KeyError: u'\xe9'

The issuer_name value: Mario José .....

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

tcamberlin commented 1 year ago

I have the same issue on V8. The problem comes from the accent on the company name (the comment makes think that this is user name).