mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-13 03:25:45 +00:00
fixes to tokens
This commit is contained in:
@@ -220,9 +220,10 @@ class ValidateJinja2Template(object):
|
||||
f"The following tokens used in the notification are not valid: {undefined}"
|
||||
)
|
||||
|
||||
regex = re.compile('{.*?}')
|
||||
regex = re.compile('{{(.*?)}}')
|
||||
valid_tokens = list(notification.valid_tokens.keys())
|
||||
for p in re.findall(regex, field.data):
|
||||
if not p.strip('{}') in notification.valid_tokens:
|
||||
if not p.strip() in valid_tokens:
|
||||
message = field.gettext('Token \'%s\' is not a valid token.')
|
||||
raise ValidationError(message % (p))
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<td>The diff output - differences only</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>{{ '{diff_full}' }}</code></td>
|
||||
<td><code>{{ '{{ diff_full }}' }}</code></td>
|
||||
<td>The diff output - full difference output</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user