Reputation: 73
In order to get current session user id we use: request.session.uid
.
For example in an input type it's like this:
<input type="text" class="form-control form-control-lg" name="current_user_id" readonly="1" t-att-value="request.session.uid"></input>
But how to get the email address instead of id?
Upvotes: 1
Views: 740
Reputation: 3610
You can find the current user in request.env.user object and refer to users's email field like this:
<input type="text" class="form-control form-control-lg" name="current_user_email" readonly="1" t-att-value="request.env.user.email"></input>
Br,
Veikko
Upvotes: 1