From 22178c5b23387d3e835e840fcf1e233351ce819a Mon Sep 17 00:00:00 2001 From: SamR1 Date: Sun, 28 Jan 2018 11:28:47 +0100 Subject: [PATCH] API: minor fix --- mpwo_api/mpwo_api/activities/models.py | 6 ++++-- mpwo_api/mpwo_api/users/models.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mpwo_api/mpwo_api/activities/models.py b/mpwo_api/mpwo_api/activities/models.py index 1b016a5d..ac7b0428 100644 --- a/mpwo_api/mpwo_api/activities/models.py +++ b/mpwo_api/mpwo_api/activities/models.py @@ -33,8 +33,10 @@ class Activity(db.Model): db.ForeignKey('sports.id'), nullable=False) gpx = db.Column(db.String(255), nullable=True) - creation_date = db.Column(db.DateTime, default=datetime.datetime.now) - modification_date = db.Column(db.DateTime, onupdate=datetime.datetime.now) + creation_date = db.Column( + db.DateTime, default=datetime.datetime.utcnow) + modification_date = db.Column( + db.DateTime, onupdate=datetime.datetime.utcnow) activity_date = db.Column(db.DateTime, nullable=False) duration = db.Column(db.Interval, nullable=False) pauses = db.Column(db.Interval, nullable=True) diff --git a/mpwo_api/mpwo_api/users/models.py b/mpwo_api/mpwo_api/users/models.py index 7e0e72c0..8878b76a 100644 --- a/mpwo_api/mpwo_api/users/models.py +++ b/mpwo_api/mpwo_api/users/models.py @@ -28,7 +28,7 @@ class User(db.Model): def __init__( self, username, email, password, - created_at=datetime.datetime.now()): + created_at=datetime.datetime.utcnow()): self.username = username self.email = email self.password = bcrypt.generate_password_hash(