forked from CGM_Public/pretix_original
Detect more invalid placeholder specs
This commit is contained in:
@@ -23,6 +23,12 @@ class PlaceholderValidator(BaseValidator):
|
|||||||
self.__call__(v)
|
self.__call__(v)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if value.count('{') != value.count('}'):
|
||||||
|
raise ValidationError(
|
||||||
|
_('Invalid placeholder syntax: You used a different number of "{" than of "}".'),
|
||||||
|
code='invalid',
|
||||||
|
)
|
||||||
|
|
||||||
data_placeholders = list(re.findall(r'({[\w\s]*})', value, re.X))
|
data_placeholders = list(re.findall(r'({[\w\s]*})', value, re.X))
|
||||||
invalid_placeholders = []
|
invalid_placeholders = []
|
||||||
for placeholder in data_placeholders:
|
for placeholder in data_placeholders:
|
||||||
|
|||||||
Reference in New Issue
Block a user