Mercurial > kallithea
changeset 8785:6d2b7e320512
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 09 Nov 2020 17:47:07 +0100 |
parents | f01bad8101e4 |
children | 5d8bfda01cf5 |
files | kallithea/model/notification.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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, }