Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
2901 Vizualizări

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)])
Imagine profil
Abandonează
Cel mai bun răspuns

Hello,

You will try this

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

Thank you,
Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează

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 Răspunsuri Vizualizări Activitate
1
iul. 25
491
1
feb. 25
1245
0
sept. 23
2192
2
iun. 23
4011
1
aug. 22
12755