This commit is contained in:
bkfox 2019-10-11 16:35:27 +02:00
parent c7beb43311
commit be0ecb665e

View File

@ -100,7 +100,7 @@ class Page(models.Model):
def save(self, *args, **kwargs):
if not self.slug:
self.slug = slugify(self.title)
count = Page.objects.all(slug__startswith=self.slug).count()
count = Page.objects.filter(slug__startswith=self.slug).count()
if count:
self.slug += '-' + count
if self.is_published and self.pub_date is None: