Skip to content

Commit 9053922

Browse files
committed
Fix AccessList RegexValidator Bug
1 parent 11203e2 commit 9053922

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.1.5 on 2023-02-02 22:34
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("netbox_acls", "0003_netbox_acls"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="accesslist",
15+
name="name",
16+
field=models.CharField(
17+
max_length=500,
18+
validators=[
19+
django.core.validators.RegexValidator(
20+
"^[a-zA-Z0-9-_]+$",
21+
"Only alphanumeric, hyphens, and underscores characters are allowed.",
22+
)
23+
],
24+
),
25+
),
26+
]

netbox_acls/models/access_lists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
alphanumeric_plus = RegexValidator(
24-
r"^[0-9a-zA-Z,-,_]*$",
24+
r"^[a-zA-Z0-9-_]+$",
2525
"Only alphanumeric, hyphens, and underscores characters are allowed.",
2626
)
2727

0 commit comments

Comments
 (0)