Skip to content
Snippets Groups Projects
Unverified Commit fa2941ec authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] website_mail_channel: fix member count

Was showing 0 for the public user
parent a54c60b4
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,10 @@ class MailGroup(http.Controller):
[], ['res_id'])
message_data = dict((message['res_id'], message['res_id_count']) for message in messages)
group_data = dict((group.id, {'monthly_message_nbr': message_data.get(group.id, 0)}) for group in groups)
group_data = dict(
(group.id, {'monthly_message_nbr': message_data.get(group.id, 0),
'members_count': len(group.channel_partner_ids)})
for group in groups.sudo())
return request.render('website_mail_channel.mail_channels', {'groups': groups, 'group_data': group_data})
@http.route(["/groups/is_member"], type='json', auth="public", website=True)
......
......@@ -50,7 +50,7 @@
<div t-esc="group.description" class="text-muted"/>
</div>
<div class="col-md-2">
<i class='fa fa-fw fa-user'/> <t t-esc="len(group.channel_partner_ids)"/> members<br />
<i class='fa fa-fw fa-user'/> <t t-esc="group_data[group.id]['members_count']"/> members<br />
<i class='fa fa-fw fa-envelope-o'/> <t t-raw="group_data[group.id]['monthly_message_nbr']"/> messages / month
</div>
<div class="col-md-3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment