diff options
-rw-r--r-- | fietsboek/models/user.py | 4 | ||||
-rw-r--r-- | fietsboek/views/detail.py | 2 | ||||
-rw-r--r-- | fietsboek/views/profile.py | 2 | ||||
-rw-r--r-- | fietsboek/views/upload.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/fietsboek/models/user.py b/fietsboek/models/user.py index c8296c6..84aa4d9 100644 --- a/fietsboek/models/user.py +++ b/fietsboek/models/user.py @@ -286,7 +286,7 @@ class Token(Base): :vartype uuid: str :ivar token_type: The type of the token. :vartype token_type: TokenType - :ivar date: Date of the token creation. + :ivar date: Date of the token creation, in UTC. :vartype date: datetime.datetime :ivar user: User that this token belongs to. :vartype user: User @@ -313,7 +313,7 @@ class Token(Base): :rtype: Token """ token_uuid = str(uuid.uuid4()) - now = datetime.datetime.now() + now = datetime.datetime.utcnow() return cls(user=user, uuid=token_uuid, date=now, token_type=token_type) diff --git a/fietsboek/views/detail.py b/fietsboek/views/detail.py index 5d969e7..9153047 100644 --- a/fietsboek/views/detail.py +++ b/fietsboek/views/detail.py @@ -81,7 +81,7 @@ def add_comment(request): comment = models.Comment( track=track, author=request.identity, - date=datetime.datetime.now(), + date=datetime.datetime.utcnow(), title=request.params["title"], text=request.params["comment"], ) diff --git a/fietsboek/views/profile.py b/fietsboek/views/profile.py index 7085c56..ad481db 100644 --- a/fietsboek/views/profile.py +++ b/fietsboek/views/profile.py @@ -95,7 +95,7 @@ def do_add_friend(request): friend_req = models.FriendRequest( sender=request.identity, recipient=candidate, - date=datetime.datetime.now(), + date=datetime.datetime.utcnow(), ) request.dbsession.add(friend_req) request.session.flash(request.localizer.translate(_("flash.friend_request_sent"))) diff --git a/fietsboek/views/upload.py b/fietsboek/views/upload.py index 4db0cd6..7a1059b 100644 --- a/fietsboek/views/upload.py +++ b/fietsboek/views/upload.py @@ -62,7 +62,7 @@ def do_upload(request): LOGGER.info("Could not parse gpx: %s", exc) return HTTPFound(request.route_url('upload')) - now = datetime.datetime.now() + now = datetime.datetime.utcnow() upload = models.Upload( owner=request.identity, |