diff --git a/rhodecode/integrations/types/email.py b/rhodecode/integrations/types/email.py --- a/rhodecode/integrations/types/email.py +++ b/rhodecode/integrations/types/email.py @@ -127,11 +127,15 @@ repo_push_template_html = Template(''' </td></tr> <tr> <td style="padding:15px;" valign="top"> - % for commit in data['push']['commits']: - <a href="${commit['url']}">${commit['short_id']}</a> by ${commit['author']} at ${commit['date']} <br/> - ${commit['message_html']} <br/> - <br/> - % endfor + % if data['push']['commits']: + % for commit in data['push']['commits']: + <a href="${commit['url']}">${commit['short_id']}</a> by ${commit['author']} at ${commit['date']} <br/> + ${commit['message_html']} <br/> + <br/> + % endfor + % else: + No commit data + % endif </td> </tr> </table> @@ -147,8 +151,6 @@ repo_push_template_html = Template(''' ''') - - class EmailSettingsSchema(colander.Schema): @colander.instantiate(validator=colander.Length(min=1)) class recipients(colander.SequenceSchema):