Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion blawx/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.dispatch import receiver
from django.db import models
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from .parse_an import generate_tree
from cobalt.hierarchical import Act
from clean.clean import generate_akn
Expand Down Expand Up @@ -54,7 +55,8 @@ class Meta:

class BlawxTest(models.Model):
ruledoc = models.ForeignKey(RuleDoc, related_name='tests', on_delete=models.CASCADE)
test_name = models.CharField(max_length=200)
validate_test_name = RegexValidator(regex="^[-a-zA-Z0-9_]+$",message="Test names cannot have spaces or special characters.")
test_name = models.CharField(max_length=200,validators=[validate_test_name])
xml_content = models.TextField(default="",blank=True)
scasp_encoding = models.TextField(default="",blank=True)
tutorial = models.TextField(default="",blank=True)
Expand Down