From de99911e385b2734bd611229b3020f7bfe65019a Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Thu, 5 Mar 2020 19:02:44 +0000 Subject: [PATCH] Add regexp validation of Schedule.name - Legacy-Id: 17388 --- ietf/meeting/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ietf/meeting/models.py b/ietf/meeting/models.py index 60c4142fc..a3fb5fbb1 100644 --- a/ietf/meeting/models.py +++ b/ietf/meeting/models.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2007-2019, All Rights Reserved +# Copyright The IETF Trust 2007-2020, All Rights Reserved # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals @@ -14,7 +14,7 @@ import string import debug # pyflakes:ignore -from django.core.validators import MinValueValidator +from django.core.validators import MinValueValidator, RegexValidator from django.db import models from django.db.models import Max from django.conf import settings @@ -611,7 +611,7 @@ class Schedule(models.Model): schedule, others may copy it """ meeting = ForeignKey(Meeting, null=True, related_name='schedule_set') - name = models.CharField(max_length=16, blank=False) + name = models.CharField(max_length=16, blank=False, help_text="Letters, numbers and -:_ allowed.", validators=[RegexValidator(r'^[A-Za-z0-9-:_]*$')]) owner = ForeignKey(Person) visible = models.BooleanField(default=True, help_text="Make this agenda available to those who know about it.") public = models.BooleanField(default=True, help_text="Make this agenda publically available.")