This commit is contained in:
bkfox 2019-10-11 16:36:02 +02:00
parent be0ecb665e
commit cb51dca5bb

View File

@ -102,7 +102,7 @@ class Page(models.Model):
self.slug = slugify(self.title) self.slug = slugify(self.title)
count = Page.objects.filter(slug__startswith=self.slug).count() count = Page.objects.filter(slug__startswith=self.slug).count()
if count: if count:
self.slug += '-' + count self.slug += '-' + str(count)
if self.is_published and self.pub_date is None: if self.is_published and self.pub_date is None:
self.pub_date = tz.now() self.pub_date = tz.now()
elif not self.is_published: elif not self.is_published: