mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
12468 disallow double underscores in custom field names
This commit is contained in:
parent
259d0e96f2
commit
280ee13361
@ -81,8 +81,8 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
|||||||
help_text=_('Internal field name'),
|
help_text=_('Internal field name'),
|
||||||
validators=(
|
validators=(
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
regex=r'^[a-z0-9_]+$',
|
regex=r'^(?!.*__.*)^[a-z0-9_]+$',
|
||||||
message="Only alphanumeric characters and underscores are allowed.",
|
message="Only alphanumeric characters and underscores (no double-underscores) are allowed.",
|
||||||
flags=re.IGNORECASE
|
flags=re.IGNORECASE
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user