Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
2921 Prikazi

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
Opusti
Best Answer

Hello,

You will try this

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

Thank you,
Avatar
Opusti
Avtor Best Answer

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

Avatar
Opusti

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 Odgovori Prikazi Aktivnost
1
jul. 25
535
1
feb. 25
1250
0
sep. 23
2196
2
jun. 23
4035
1
avg. 22
12775