mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
12468 use inverse match
This commit is contained in:
parent
d55162ce4f
commit
58c74b208c
@ -24,8 +24,9 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
django.core.validators.RegexValidator(
|
||||
flags=re.RegexFlag['IGNORECASE'],
|
||||
inverse_match=True,
|
||||
message='No double-underscores are allowed.',
|
||||
regex='^(?!.*__.*)',
|
||||
regex=r'__',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -75,6 +75,7 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
||||
null=True,
|
||||
help_text=_('The type of NetBox object this field maps to (for object fields)')
|
||||
)
|
||||
# regex=r'^(?!.*__.*)', ^((?!__).)*$
|
||||
name = models.CharField(
|
||||
max_length=50,
|
||||
unique=True,
|
||||
@ -86,9 +87,10 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
||||
flags=re.IGNORECASE
|
||||
),
|
||||
RegexValidator(
|
||||
regex=r'^(?!.*__.*)',
|
||||
regex=r'__',
|
||||
message="No double-underscores are allowed.",
|
||||
flags=re.IGNORECASE
|
||||
flags=re.IGNORECASE,
|
||||
inverse_match=True
|
||||
),
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user