mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
12468 review changes
This commit is contained in:
parent
94daf74635
commit
629669e786
@ -1,6 +1,8 @@
|
||||
# Generated by Django 4.1.7 on 2023-03-27 17:31
|
||||
|
||||
from django.db import migrations
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import re
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -13,4 +15,24 @@ class Migration(migrations.Migration):
|
||||
migrations.DeleteModel(
|
||||
name='JobResult',
|
||||
),
|
||||
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 are allowed.',
|
||||
regex='^[a-z0-9_]+$',
|
||||
),
|
||||
django.core.validators.RegexValidator(
|
||||
flags=re.RegexFlag['IGNORECASE'],
|
||||
message='No double-underscores are allowed.',
|
||||
regex='^(?!.*__.*)',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]
|
||||
|
@ -1,29 +0,0 @@
|
||||
# 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_]+$',
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
]
|
@ -81,8 +81,13 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
||||
help_text=_('Internal field name'),
|
||||
validators=(
|
||||
RegexValidator(
|
||||
regex=r'^(?!.*__.*)^[a-z0-9_]+$',
|
||||
message="Only alphanumeric characters and underscores (no double-underscores) are allowed.",
|
||||
regex=r'^[a-z0-9_]+$',
|
||||
message="Only alphanumeric characters and underscores are allowed.",
|
||||
flags=re.IGNORECASE
|
||||
),
|
||||
RegexValidator(
|
||||
regex=r'^(?!.*__.*)',
|
||||
message="No double-underscores are allowed.",
|
||||
flags=re.IGNORECASE
|
||||
),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user