pub_date tz aware

This commit is contained in:
bkfox 2019-10-11 16:34:19 +02:00
parent 87df063bb4
commit c7beb43311

View File

@ -104,7 +104,7 @@ class Page(models.Model):
if count:
self.slug += '-' + count
if self.is_published and self.pub_date is None:
self.pub_date = tz.datetime.now()
self.pub_date = tz.now()
elif not self.is_published:
self.pub_date = None
super().save(*args, **kwargs)