From 280ee13361660c7b229c4fcf2b1cb96dba3b564d Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 8 May 2023 08:57:14 -0700 Subject: [PATCH] 12468 disallow double underscores in custom field names --- netbox/extras/models/customfields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/extras/models/customfields.py b/netbox/extras/models/customfields.py index 439d15edc..635f9c882 100644 --- a/netbox/extras/models/customfields.py +++ b/netbox/extras/models/customfields.py @@ -81,8 +81,8 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel): help_text=_('Internal field name'), validators=( RegexValidator( - regex=r'^[a-z0-9_]+$', - message="Only alphanumeric characters and underscores are allowed.", + regex=r'^(?!.*__.*)^[a-z0-9_]+$', + message="Only alphanumeric characters and underscores (no double-underscores) are allowed.", flags=re.IGNORECASE ), )