Skip to content
Snippets Groups Projects
Commit 26c7ff91 authored by Jeremy Kersten's avatar Jeremy Kersten
Browse files

[FIX] gamification: don't use multimode from render_template

If render_template get list and not id, a dict is returned.
Force the param to be a int, allow to don't use the multimode from render_template.

Avoid to get message like:
 <p>{1: u'\n        </p><p>Congratulation, you have received the badge <strong>Autobiographer</strong> !\n        </p>\n\n'}
 <p>{2: u'\n        </p><p>Congratulation, you have received the badge <strong>Autobiographer</strong> !\n        </p>\n\n'}
 <p>{3: u'\n        </p><p>Congratulation, you have received the badge <strong>Student</strong> !\n        </p>\n\n'}
 <p>{4: u'\n        </p><p>Congratulation, you have received the badge <strong>Supporter</strong> !\n        </p>\n\n'}
parent f5f066f7
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ class BadgeUser(models.Model):
# .ids would trigger the "multi mode" which returns a mapping of
# res_id to templates
template = template_id.get_email_template(badge_user.id)
body_html = Template.with_context(template._context).render_template(template.body_html, 'gamification.badge.user', badge_user.ids)
body_html = Template.with_context(template._context).render_template(template.body_html, 'gamification.badge.user', badge_user.id)
badge_user.user_id.message_post(
body=body_html,
subtype='gamification.mt_badge_granted',
......
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