mirror of
https://github.com/dancojocaru2000/foxbank.git
synced 2025-02-22 23:39:36 +02:00
Fixed datetime not having correct timezone
This commit is contained in:
parent
28ac7a970e
commit
e68709092b
2 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from flask.views import MethodView
|
||||
from flask_smorest import Blueprint
|
||||
from marshmallow import Schema, fields
|
||||
|
@ -41,7 +41,7 @@ class NotificationsList(MethodView):
|
|||
|
||||
The usefulness of this endpoint is questionable besides debugging since it's a notification to self
|
||||
"""
|
||||
now = datetime.now()
|
||||
now = datetime.now(timezone.utc).astimezone()
|
||||
notification = Notification.new_notification(body, now, read)
|
||||
insert_notification(decorators.user_id, notification)
|
||||
return returns.success(notification=notification)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from datetime import date, datetime
|
||||
from datetime import date, datetime, timezone
|
||||
from flask.views import MethodView
|
||||
from flask_smorest import Blueprint
|
||||
from marshmallow import Schema, fields
|
||||
|
@ -75,7 +75,7 @@ class TransactionsList(MethodView):
|
|||
if not check_iban(destination_iban):
|
||||
return returns.abort(returns.INVALID_IBAN)
|
||||
|
||||
date = datetime.now()
|
||||
date = datetime.now(timezone.utc).astimezone()
|
||||
|
||||
# Check if transaction is to another FoxBank account
|
||||
reverse_transaction = None
|
||||
|
|
Loading…
Add table
Reference in a new issue