# HG changeset patch # User Mads Kiilerich # Date 2014-07-18 19:22:01 # Node ID 8eeb3fa7bc0502299b5ce576dfb84f23412679bb # Parent 55f2f2b4c4620f39997e95d1a80cfa2344d3079f notifications: append status changes and 'Closing' to email subjects diff --git a/kallithea/model/notification.py b/kallithea/model/notification.py --- a/kallithea/model/notification.py +++ b/kallithea/model/notification.py @@ -291,10 +291,14 @@ class EmailNotificationModel(BaseModel): """ tmpl = self._subj_map[type_] try: - return tmpl % kwargs + subj = tmpl % kwargs except KeyError, e: log.error('error generating email subject for %r from %s: %s', type_, ','.join(self._subj_map.keys()), e) raise + l = [str(x) for x in [kwargs.get('status_change'), kwargs.get('closing_pr') and _('Closing')] if x] + if l: + subj += ' (%s)' % (', '.join(l)) + return subj def get_email_tmpl(self, type_, **kwargs): """