From 729f70142f4bc22efca12744fc9ab6850a0b2994 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 10 Sep 2021 16:33:48 -0700 Subject: [PATCH] populate_db: Fix naive datetime RuntimeWarning. Fixes these warnings from populate_db: /srv/zulip-py3-venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1419: RuntimeWarning: DateTimeField Draft.last_edit_time received a naive datetime (2021-09-10 23:33:15.063608) while time zone support is active. RuntimeWarning) /srv/zulip-py3-venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1419: RuntimeWarning: DateTimeField Draft.last_edit_time received a naive datetime (2021-09-10 23:33:15.065517) while time zone support is active. RuntimeWarning) Signed-off-by: Anders Kaseorg --- zilencer/management/commands/populate_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index 7f8f9e6d43..b181963c13 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -478,14 +478,14 @@ class Command(BaseCommand): recipient=None, topic="Release Notes", content="Release 4.0 will contain ...", - last_edit_time=datetime.now(), + last_edit_time=timezone_now(), ) Draft.objects.create( user_profile=iago, recipient=None, topic="Release Notes", content="Release 4.0 will contain many new features such as ... ", - last_edit_time=datetime.now(), + last_edit_time=timezone_now(), ) desdemona = get_user_by_delivery_email("desdemona@zulip.com", zulip_realm)