Re #148 - Always set something for {base_url} so we dont send possibly an empty body/title notification which could break some services.

pull/158/head
dgtlmoon 3 years ago
parent f3ba051df4
commit dfbc9bfc53

@ -39,11 +39,13 @@ def create_notification_parameters(n_object):
base_url = os.getenv('BASE_URL', '').strip('"') base_url = os.getenv('BASE_URL', '').strip('"')
watch_url = n_object['watch_url'] watch_url = n_object['watch_url']
if base_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 = "<base-url-env-var-not-set>"
diff_url = "{}/diff/{}".format(base_url, uuid) diff_url = "{}/diff/{}".format(base_url, uuid)
preview_url = "{}/preview/{}".format(base_url, uuid) preview_url = "{}/preview/{}".format(base_url, uuid)
else:
diff_url = preview_url = ''
return { return {
'base_url': base_url, 'base_url': base_url,

Loading…
Cancel
Save