From dfbc9bfc53d233a821d90b3d6b7e38681231d247 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 22 Jul 2021 20:09:42 +1000 Subject: [PATCH] Re #148 - Always set something for {base_url} so we dont send possibly an empty body/title notification which could break some services. --- backend/notification.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/notification.py b/backend/notification.py index e3e7e0a5..4db6c589 100644 --- a/backend/notification.py +++ b/backend/notification.py @@ -39,11 +39,13 @@ def create_notification_parameters(n_object): base_url = os.getenv('BASE_URL', '').strip('"') watch_url = n_object['watch_url'] - if base_url != '': - diff_url = "{}/diff/{}".format(base_url, uuid) - preview_url = "{}/preview/{}".format(base_url, uuid) - else: - diff_url = preview_url = '' + # Re #148 - Some people have just {base_url} in the body or title, but this may break some notification services + # like 'Join', so it's always best to atleast set something obvious so that they are not broken. + if base_url == '': + base_url = "" + + diff_url = "{}/diff/{}".format(base_url, uuid) + preview_url = "{}/preview/{}".format(base_url, uuid) return { 'base_url': base_url,