mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
12468 disallow double underscores in custom field names (#12523)
* 12468 disallow double underscores in custom field names * 12468 disallow double underscores in custom field names * 12468 review changes * 12468 correct migration * 12468 use inverse match * 12468 use inverse match * Add test for invalid custom field names --------- Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -85,6 +85,12 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
||||
message="Only alphanumeric characters and underscores are allowed.",
|
||||
flags=re.IGNORECASE
|
||||
),
|
||||
RegexValidator(
|
||||
regex=r'__',
|
||||
message="Double underscores are not permitted in custom field names.",
|
||||
flags=re.IGNORECASE,
|
||||
inverse_match=True
|
||||
),
|
||||
)
|
||||
)
|
||||
label = models.CharField(
|
||||
|
Reference in New Issue
Block a user