Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
2937 Visualizações

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
Cancelar
Melhor resposta

Hello,

You will try this

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

Thank you,
Avatar
Cancelar
Autor Melhor resposta

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

Avatar
Cancelar

hello

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

Publicações relacionadas Respostas Visualizações Atividade
1
jul. 25
562
1
fev. 25
1262
0
set. 23
2225
2
jun. 23
4047
1
ago. 22
12788