Skip to content

Commit e99f07a

Browse files
authored
Filters & Notifications - fixed tokens in filter not found notification
1 parent 08ee223 commit e99f07a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

changedetectionio/tests/test_filter_failure_notification.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
22
import time
3-
import re
43
from flask import url_for
5-
from .util import set_original_response, live_server_setup
4+
from .util import set_original_response, live_server_setup, extract_UUID_from_client
65
from changedetectionio.model import App
76

87

@@ -121,6 +120,10 @@ def run_filter_test(client, content_filter):
121120
notification = f.read()
122121
assert not 'CSS/xPath filter was not present in the page' in notification
123122

123+
# Re #1247 - All tokens got replaced
124+
uuid = extract_UUID_from_client(client)
125+
assert uuid in notification
126+
124127
# cleanup for the next
125128
client.get(
126129
url_for("form_delete", uuid="all"),

changedetectionio/update_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def send_filter_failure_notification(self, watch_uuid):
9393
return
9494

9595
n_object = {'notification_title': 'Changedetection.io - Alert - CSS/xPath filter was not present in the page',
96-
'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(
96+
'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(
9797
", ".join(watch['include_filters']),
9898
threshold),
9999
'notification_format': 'text'}

0 commit comments

Comments
 (0)