Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
2913 Представления

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)])
Аватар
Отменить
Лучший ответ

Hello,

You will try this

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

Thank you,
Аватар
Отменить
Автор Лучший ответ

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

Аватар
Отменить

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 Ответы Просмотры Активность
1
июл. 25
509
Search a message Решено
1
февр. 25
1246
0
сент. 23
2193
2
июн. 23
4024
1
авг. 22
12760