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
280ee13361
commit
94daf74635
29
netbox/extras/migrations/0093_alter_customfield_name.py
Normal file
29
netbox/extras/migrations/0093_alter_customfield_name.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Generated by Django 4.1.8 on 2023-05-08 15:57
|
||||||
|
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
('extras', '0092_delete_jobresult'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='customfield',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(
|
||||||
|
max_length=50,
|
||||||
|
unique=True,
|
||||||
|
validators=[
|
||||||
|
django.core.validators.RegexValidator(
|
||||||
|
flags=re.RegexFlag['IGNORECASE'],
|
||||||
|
message='Only alphanumeric characters and underscores (no double-underscores) are allowed.',
|
||||||
|
regex='^(?!.*__.*)^[a-z0-9_]+$',
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user