From c7beb43311d2b442fe8994de5a0eddc0a9322ced Mon Sep 17 00:00:00 2001 From: bkfox Date: Fri, 11 Oct 2019 16:34:19 +0200 Subject: [PATCH] pub_date tz aware --- aircox/models/page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aircox/models/page.py b/aircox/models/page.py index 83f87ac..2b7c4b9 100644 --- a/aircox/models/page.py +++ b/aircox/models/page.py @@ -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)