Skip to Content
Menu
This question has been flagged
2 Replies
2918 Zobrazenia

I want to find user by user's email. And here is my code but i get no result from it.

user = request.env["res.users"].search([('login', 'ilike', email)])
Avatar
Zrušiť
Best Answer

Hello,

You will try this

user = request.env["res.users"].search([('login', '=', email)])

Thank you,
Avatar
Zrušiť
Autor Best Answer

thanks for your reply, i have already tried your solution but it's not giving me any user.

Avatar
Zrušiť

hello

just use email.encode('utf-8') instead of email here [('login','=',email)] , as the email have some special character in your case.

Related Posts Replies Zobrazenia Aktivita
1
júl 25
527
1
feb 25
1249
0
sep 23
2194
2
jún 23
4032
1
aug 22
12769