From 31b1a6e8c2ebe79cc9f805032f57da54a7b681f5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 18 Apr 2021 20:03:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Use=20timezone.now()=20instead?= =?UTF-8?q?=20of=20datetime.now()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sophon/core/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/sophon/core/models.py b/backend/sophon/core/models.py index a5bdd11..33cb253 100644 --- a/backend/sophon/core/models.py +++ b/backend/sophon/core/models.py @@ -1,15 +1,14 @@ from django.db import models from django.core import validators from django.contrib.auth.models import User +from django.utils import timezone import pandas import pandasdmx import pandasdmx.message import typing as t import json import abc -import datetime import logging -import pytz log = logging.getLogger(__name__) @@ -292,7 +291,7 @@ class DataSource(models.Model): log.debug(f"Synced {db_flow}!") log.debug(f"Updating last_sync value of {self!r}") - self.last_sync = datetime.datetime.now() + self.last_sync = timezone.now() self.save() log.info(f"Finished syncing DataFlows of {self!r}")