Changeset - 8eeb3fa7bc05
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-07-18 19:22:01
madski@unity3d.com
notifications: append status changes and 'Closing' to email subjects
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/model/notification.py
Show inline comments
 
@@ -288,16 +288,20 @@ class EmailNotificationModel(BaseModel):
 
    def get_email_description(self, type_, **kwargs):
 
        """
 
        return subject for email based on given type
 
        """
 
        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):
 
        """
 
        return generated template for email based on given type
 
        """
 

	
0 comments (0 inline, 0 general)