# HG changeset patch # User lisaq # Date 2016-07-28 15:35:30 # Node ID fafa37cfca90bd4f14105fb345a9177a9a2c6dcc # Parent 02bea3f6375f1b6c05fb0d528900a75f5a6a380b notifications: adjusting how instance name is passed and fixing tests diff --git a/rhodecode/model/notification.py b/rhodecode/model/notification.py --- a/rhodecode/model/notification.py +++ b/rhodecode/model/notification.py @@ -327,7 +327,8 @@ class EmailNotificationModel(BaseModel): :return: """ _kwargs = { - 'instance_url': h.url('home', qualified=True) + 'instance_url': h.url('home', qualified=True), + 'rhodecode_instance_name': getattr(c, 'rhodecode_name', '') } _kwargs.update(kwargs) return _kwargs diff --git a/rhodecode/templates/email_templates/base.mako b/rhodecode/templates/email_templates/base.mako --- a/rhodecode/templates/email_templates/base.mako +++ b/rhodecode/templates/email_templates/base.mako @@ -88,8 +88,8 @@ ${_('RhodeCode')} - % if c.rhodecode_name: - - ${c.rhodecode_name} + % if rhodecode_instance_name: + - ${rhodecode_instance_name} % endif diff --git a/rhodecode/tests/lib/test_mako_emails.py b/rhodecode/tests/lib/test_mako_emails.py --- a/rhodecode/tests/lib/test_mako_emails.py +++ b/rhodecode/tests/lib/test_mako_emails.py @@ -27,9 +27,9 @@ def test_render_email(pylonsapp): assert body_plaintext == 'Email Plaintext Body' # body - assert 'This is a notification ' \ - 'from RhodeCode. http://test.example.com:80/' in body - assert 'Email Body' in body + assert 'This is a notification ' \ + 'from RhodeCode. http://test.example.com:80/' in body + assert 'Email Body' in body def test_render_pr_email(pylonsapp, user_admin):