forked from odoo/odoo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] base: Make user lookup by email case insensitive.
This avoids user frustration when attempting to reset password via email address.
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,3 +192,10 @@ def test_read_group_with_reified_field(self): | |
# Verify that the read_group is raising an error if reified field is used as groupby | ||
with self.assertRaises(ValueError): | ||
User.read_group([], fnames + [reified_fname], [reified_fname]) | ||
|
||
def test_get_email_domain(self): | ||
""" Check that _get_email_domain escapes wildcards """ | ||
User = self.env['res.users'] | ||
self.assertEqual(User._get_email_domain('\\[email protected]'), [('email', '=ilike', '\\\\[email protected]')], "backslashes should be escaped") | ||
self.assertEqual(User._get_email_domain('%[email protected]'), [('email', '=ilike', '\\%[email protected]')], "percents should be escaped") | ||
self.assertEqual(User._get_email_domain('[email protected]'), [('email', '=ilike', '\\[email protected]')], "underscores should be escaped") |