From c2deb189452cf84b343c502be0096dde02cf211e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sat, 23 Jul 2022 16:29:14 +0200 Subject: [PATCH] Oops --- changedetectionio/forms.py | 2 +- changedetectionio/templates/settings.html | 5 ++++- changedetectionio/update_worker.py | 5 ++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index a5f89b924..9d29c5c17 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -391,7 +391,7 @@ class globalSettingsApplicationForm(commonSettingsForm): filter_failure_notification_threshold_attempts = IntegerField('Number of times the filter can be missing before sending a notification', render_kw={"style": "width: 5em;"}, - validators=[validators.NumberRange(min=10, + validators=[validators.NumberRange(min=0, message="Should contain zero or more attempts")]) diff --git a/changedetectionio/templates/settings.html b/changedetectionio/templates/settings.html index b5ad2964b..8b3e2e8de 100644 --- a/changedetectionio/templates/settings.html +++ b/changedetectionio/templates/settings.html @@ -38,7 +38,10 @@
{{ render_field(form.application.form.filter_failure_notification_threshold_attempts, class="filter_failure_notification_threshold_attempts") }} - After this many consecutive times that the CSS/xPath filter is missing, send a notification + After this many consecutive times that the CSS/xPath filter is missing, send a notification +
+ Set to 0 to disable +
{% if not hide_remove_pass %} diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index de6b02b97..e9dfcba24 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -91,10 +91,9 @@ class update_worker(threading.Thread): c += 1 # Send notification if we reached the threshold? - threshold = self.datastore.data['settings']['application'].get('filter_failure_notification_threshold_attempts', - False) + threshold = self.datastore.data['settings']['application'].get('filter_failure_notification_threshold_attempts', 0) print("Filter for {} not found, consecutive_filter_failures: {}".format(uuid, c)) - if threshold and c >= threshold: + if threshold >0 and c >= threshold: self.send_filter_failure_notification(uuid) c = 0