Notifications - Support for commented out notification URLs (#2825 #2769)

pull/2842/head
dgtlmoon 3 weeks ago committed by GitHub
parent 2614b275f0
commit 1fb0adde54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -308,8 +308,12 @@ class ValidateAppRiseServers(object):
# so that the custom endpoints are registered
from changedetectionio.apprise_plugin import apprise_custom_api_call_wrapper
for server_url in field.data:
if not apobj.add(server_url):
message = field.gettext('\'%s\' is not a valid AppRise URL.' % (server_url))
url = server_url.strip()
if url.startswith("#"):
continue
if not apobj.add(url):
message = field.gettext('\'%s\' is not a valid AppRise URL.' % (url))
raise ValidationError(message)
class ValidateJinja2Template(object):

@ -79,6 +79,10 @@ def process_notification(n_object, datastore):
n_title = jinja_render(template_str=n_object.get('notification_title', ''), **notification_parameters)
url = url.strip()
if url.startswith('#'):
logger.trace(f"Skipping commented out notification URL - {url}")
continue
if not url:
logger.warning(f"Process Notification: skipping empty notification URL.")
continue

Loading…
Cancel
Save