Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2875 Zobrazení

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
Zrušit
Nejlepší odpověď

Hello,

You will try this

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

Thank you,
Avatar
Zrušit
Autor Nejlepší odpověď

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

Avatar
Zrušit

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 Odpovědi Zobrazení Aktivita
1
čvc 25
436
1
úno 25
1223
0
zář 23
2169
2
čvn 23
3950
1
srp 22
12718