Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2940 Visualizzazioni

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
Abbandona
Risposta migliore

Hello,

You will try this

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

Thank you,
Avatar
Abbandona
Autore Risposta migliore

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

Avatar
Abbandona

hello

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

Post correlati Risposte Visualizzazioni Attività
1
lug 25
564
1
feb 25
1263
0
set 23
2227
2
giu 23
4049
1
ago 22
12790