changeset 4382:8eeb3fa7bc05

notifications: append status changes and 'Closing' to email subjects
author Mads Kiilerich <madski@unity3d.com>
date Fri, 18 Jul 2014 19:22:01 +0200
parents 55f2f2b4c462
children 2bb17f6f3044
files kallithea/model/notification.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/notification.py	Fri Jul 18 19:22:01 2014 +0200
+++ b/kallithea/model/notification.py	Fri Jul 18 19:22:01 2014 +0200
@@ -291,10 +291,14 @@
         """
         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):
         """