Skip to content
Permalink
Browse files

[FIX] portal: Portal User creation login check

- When creating a user from the "Grant Portal Access" wizard, the code
  checks for duplicate users.
  It does so by checking if there is a user with the same login as the
  one we want to create.

  The check is case sensitive which could lead to issues.
  For example a mistyped email (with a uppercase somewhere) could fail
  the duplicate user check.
  Since emails are not case sensitive, we want the check to be case
  insensitive too.

  OPW-1932918

closes #31818

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
  • Loading branch information...
tbe-odoo committed Mar 13, 2019
1 parent 747e05d commit 7ac7c9776234ecb3e6ee78a441bb812c5a4086ed
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/portal/wizard/portal_wizard.py
@@ -93,7 +93,7 @@ def get_error_messages(self):
partners_error_empty |= wizard_user.partner_id
elif email in emails:
partners_error_emails |= wizard_user.partner_id
user = self.env['res.users'].sudo().with_context(active_test=False).search([('login', '=', email)])
user = self.env['res.users'].sudo().with_context(active_test=False).search([('login', '=ilike', email)])
if user:
partners_error_user |= wizard_user.partner_id
emails.append(email)

0 comments on commit 7ac7c97

Please sign in to comment.
You can’t perform that action at this time.