Skip to Content
Menu
This question has been flagged
2 Replies
2959 Rodiniai

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)])
Portretas
Atmesti
Best Answer

Hello,

You will try this

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

Thank you,
Portretas
Atmesti
Autorius Best Answer

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

Portretas
Atmesti

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 Rodiniai Veikla
1
liep. 25
586
1
vas. 25
1296
0
rugs. 23
2244
2
birž. 23
4077
1
rugp. 22
12826