X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/66e84bbddc80e7f3ac04da6433a70da7da97698b..8e218bdb4f1958b28ce249511e5acdb63eeb326b:/sommitrealweird/bpcms/models.py?ds=inline diff --git a/sommitrealweird/bpcms/models.py b/sommitrealweird/bpcms/models.py index 70d398a..ad88e4a 100644 --- a/sommitrealweird/bpcms/models.py +++ b/sommitrealweird/bpcms/models.py @@ -1,5 +1,5 @@ from django.db import models -from bpcms.content_val import is_unique_name +from bpcms.content_val import is_allowed_name from django.conf import settings FORMAT_CHOICES = ( @@ -12,7 +12,7 @@ class Document(models.Model): islive = models.BooleanField() folder = models.ForeignKey('Folder', null=True, blank=True) format = models.CharField(maxlength=10, choices=FORMAT_CHOICES) - slug = models.SlugField(prepopulate_from=("title",)) + slug = models.SlugField(prepopulate_from=("title",), validator_list=[is_allowed_name,]) content = models.TextField() def __str__(self): @@ -52,7 +52,7 @@ class Document(models.Model): class Folder(models.Model): title = models.CharField(maxlength=150) - slug = models.SlugField(prepopulate_from=("title",)) + slug = models.SlugField(prepopulate_from=("title",), validator_list=[is_allowed_name,]) parent = models.ForeignKey('self', null=True, blank=True) def __str__(self):