Add slug validator for org
This commit is contained in:
parent
3791d2e90f
commit
08fae0d0dc
2 changed files with 32 additions and 0 deletions
|
@ -34,6 +34,9 @@ class Organization(models.Model):
|
|||
verbose_name=_("organization slug"),
|
||||
help_text=_("Organization name shown in URL"),
|
||||
unique=True,
|
||||
validators=[
|
||||
RegexValidator("^[-a-zA-Z0-9]+$", _("Only alphanumeric and hyphens"))
|
||||
],
|
||||
)
|
||||
short_name = models.CharField(
|
||||
max_length=20,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue