Skip to content

Commit 6483010

Browse files
committed
Ensure that portfolio snapshots are created with utc timezone
1 parent 3c11040 commit 6483010

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(
4141
self.created_at = created_at
4242

4343
# Make sure that created_at is a timezone aware datetime object
44-
self.created_at.replace(tzinfo=timezone.utc)
44+
self.created_at = self.created_at.replace(tzinfo=timezone.utc)
4545

4646
if position_snapshots is None:
4747
position_snapshots = []
@@ -184,7 +184,7 @@ def from_dict(data):
184184
created_at = parser.parse(created_at_str)
185185

186186
# Ensure created_at is timezone aware
187-
created_at.replace(tzinfo=timezone.utc)
187+
created_at = created_at.replace(tzinfo=timezone.utc)
188188

189189
return PortfolioSnapshot(
190190
net_size=data.get("net_size", 0.0),

0 commit comments

Comments
 (0)