Add regexp validation of Schedule.name

- Legacy-Id: 17388
This commit is contained in:
Ole Laursen 2020-03-05 19:02:44 +00:00
parent c34fec535f
commit de99911e38

View file

@ -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.")