# HG changeset patch # User Mads Kiilerich # Date 2020-11-09 17:47:07 # 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 --git a/kallithea/model/notification.py b/kallithea/model/notification.py --- a/kallithea/model/notification.py +++ b/kallithea/model/notification.py @@ -103,7 +103,7 @@ class NotificationModel(object): # 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, }