Changeset - 6d2b7e320512
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2020-11-09 17:47:07
mads@kiilerich.com
Grafted from: 5243755e81ab
notifications: only render body with mentions if there is a body

Notifications for registering a user would pass body=None. It is unfortunate to
pass None all the way to render_w_mentions - it seems fair enough that this
function expects a str.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/model/notification.py
Show inline comments
 
@@ -100,13 +100,13 @@ class NotificationModel(object):
 
        if 'threading' in email_kwargs:
 
            headers['References'] = ' '.join('<%s>' % x for x in email_kwargs['threading'])
 

	
 
        # this is passed into template
 
        created_on = fmt_date(datetime.datetime.now())
 
        html_kwargs = {
 
                  'body': h.render_w_mentions(body, repo_name),
 
                  'body': None if body is None else h.render_w_mentions(body, repo_name),
 
                  'when': created_on,
 
                  'user': created_by_obj.username,
 
                  }
 

	
 
        txt_kwargs = {
 
                  'body': body,
0 comments (0 inline, 0 general)