# HG changeset patch # User Mads Kiilerich # Date 1604940427 -3600 # Node ID 6d2b7e320512b9e33ae0c185dfcb4cfde9ae891b # Parent f01bad8101e41e3504e7f780cbdc6551d7524449 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. diff -r f01bad8101e4 -r 6d2b7e320512 kallithea/model/notification.py --- a/kallithea/model/notification.py Mon Nov 09 15:58:52 2020 +0100 +++ b/kallithea/model/notification.py Mon Nov 09 17:47:07 2020 +0100 @@ -103,7 +103,7 @@ # 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, }