Skip to Content
Menú
This question has been flagged
2 Respostes
2860 Vistes

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

Hello,

You will try this

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

Thank you,
Avatar
Descartar
Autor Best Answer

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

Avatar
Descartar

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 Respostes Vistes Activitat
1
de jul. 25
391
1
de febr. 25
1211
0
de set. 23
2151
2
de juny 23
3910
1
d’ag. 22
12681