diff options
| author | Yannick Tivisse <yti@odoo.com> | 2018-10-01 17:26:32 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2018-10-02 12:35:34 +0200 |
| commit | 532d82a7a9952c5ee843f91e63aae1ca986c6c9d (patch) | |
| tree | 687d28b385891b1ea6bd37e71267f2bb26a5597e /addons/gamification/models/challenge.py | |
| parent | b2b9545cf38855fdb97e992aa2883cdab6909e96 (diff) | |
[IMP] mail: Make mail.compose.message code more readable
Purpose
=======
Remove the method 'render_template' in mail.compose.message as the indirection
is not useful. Call the method on the correct model (mail.template) directly.
Diffstat (limited to 'addons/gamification/models/challenge.py')
| -rw-r--r-- | addons/gamification/models/challenge.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index bf8e17fa4a2..dae80246da1 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -545,7 +545,7 @@ class Challenge(models.Model): if challenge.visibility_mode == 'ranking': lines_boards = challenge._get_serialized_challenge_lines(restrict_goals=subset_goals) - body_html = MailTemplates.with_context(challenge_lines=lines_boards).render_template(challenge.report_template_id.body_html, 'gamification.challenge', challenge.id) + body_html = MailTemplates.with_context(challenge_lines=lines_boards)._render_template(challenge.report_template_id.body_html, 'gamification.challenge', challenge.id) # send to every follower and participant of the challenge challenge.message_post( @@ -566,7 +566,7 @@ class Challenge(models.Model): if not lines: continue - body_html = MailTemplates.sudo(user).with_context(challenge_lines=lines).render_template( + body_html = MailTemplates.sudo(user).with_context(challenge_lines=lines)._render_template( challenge.report_template_id.body_html, 'gamification.challenge', challenge.id) |
