Filters & Notifications - fixed tokens in filter not found notification

pull/1259/head
dgtlmoon 2 years ago committed by GitHub
parent 08ee223b5f
commit e99f07a51d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,7 @@
import os import os
import time import time
import re
from flask import url_for from flask import url_for
from .util import set_original_response, live_server_setup from .util import set_original_response, live_server_setup, extract_UUID_from_client
from changedetectionio.model import App from changedetectionio.model import App
@ -121,6 +120,10 @@ def run_filter_test(client, content_filter):
notification = f.read() notification = f.read()
assert not 'CSS/xPath filter was not present in the page' in notification assert not 'CSS/xPath filter was not present in the page' in notification
# Re #1247 - All tokens got replaced
uuid = extract_UUID_from_client(client)
assert uuid in notification
# cleanup for the next # cleanup for the next
client.get( client.get(
url_for("form_delete", uuid="all"), url_for("form_delete", uuid="all"),

@ -93,7 +93,7 @@ class update_worker(threading.Thread):
return return
n_object = {'notification_title': 'Changedetection.io - Alert - CSS/xPath filter was not present in the page', n_object = {'notification_title': 'Changedetection.io - Alert - CSS/xPath filter was not present in the page',
'notification_body': "Your configured CSS/xPath filters of '{}' for {{watch_url}} did not appear on the page after {} attempts, did the page change layout?\n\nLink: {{base_url}}/edit/{{watch_uuid}}\n\nThanks - Your omniscient changedetection.io installation :)\n".format( 'notification_body': "Your configured CSS/xPath filters of '{}' for {{{{watch_url}}}} did not appear on the page after {} attempts, did the page change layout?\n\nLink: {{{{base_url}}}}/edit/{{{{watch_uuid}}}}\n\nThanks - Your omniscient changedetection.io installation :)\n".format(
", ".join(watch['include_filters']), ", ".join(watch['include_filters']),
threshold), threshold),
'notification_format': 'text'} 'notification_format': 'text'}

Loading…
Cancel
Save