aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuppie2026-09-07 11:57:41 -0600
committerstuppie2026-09-07 11:57:41 -0600
commit343d0299fe75ee8ec0e87847e2ee20dd61123d80 (patch)
tree9ea59df4ebc0fdf6c1b7336361a734d0b877ac20
parent092960233652cce1f4dc7841856034a6635e9cd9 (diff)
downloadgeneralresearch-343d0299fe75ee8ec0e87847e2ee20dd61123d80.tar.gz
generalresearch-343d0299fe75ee8ec0e87847e2ee20dd61123d80.zip
Fix merge
-rw-r--r--generalresearch/managers/thl/ledger_manager/thl_ledger.py8
-rw-r--r--generalresearch/models/thl/session.py4
2 files changed, 5 insertions, 7 deletions
diff --git a/generalresearch/managers/thl/ledger_manager/thl_ledger.py b/generalresearch/managers/thl/ledger_manager/thl_ledger.py
index f1a76c4..b6a6f5b 100644
--- a/generalresearch/managers/thl/ledger_manager/thl_ledger.py
+++ b/generalresearch/managers/thl/ledger_manager/thl_ledger.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import logging
from collections import defaultdict
from collections.abc import Callable, Collection
@@ -10,7 +8,6 @@ from uuid import UUID
import numpy as np
import pandas as pd
-from generalresearch.models.thl.wallet.definitions import PayoutType
from pydantic import AwareDatetime, PositiveInt
from generalresearch.config import (
@@ -32,6 +29,7 @@ from generalresearch.managers.thl.ledger_manager.ledger import (
LedgerManager,
)
from generalresearch.models.custom_types import UUIDStr
+from generalresearch.models.thl.contest.contest_entry import ContestEntry
from generalresearch.models.thl.contest.definitions import (
ContestPrizeKind,
ContestType,
@@ -58,6 +56,7 @@ from generalresearch.models.thl.payout_format import format_payout_format
from generalresearch.models.thl.product import Product
from generalresearch.models.thl.session import Session, Status, Wall
from generalresearch.models.thl.user import User
+from generalresearch.models.thl.wallet.definitions import PayoutType
from generalresearch.models.thl.wallet.user_wallet import (
UserDisplayedWalletBalance,
UserLedgerWallet,
@@ -66,8 +65,7 @@ from generalresearch.models.thl.wallet.user_wallet import (
if TYPE_CHECKING:
from generalresearch.managers.thl.session import SessionManager
- from generalresearch.models.thl.contest.contest import ContestWinner
-
+ from generalresearch.models.thl.contest.contest import Contest, ContestWinner
logging.basicConfig()
logger = logging.getLogger("LedgerManager")
diff --git a/generalresearch/models/thl/session.py b/generalresearch/models/thl/session.py
index a9fe442..6150ecd 100644
--- a/generalresearch/models/thl/session.py
+++ b/generalresearch/models/thl/session.py
@@ -442,12 +442,12 @@ class Wall(WallBase):
def to_json(self) -> str:
# We have to handle the computed_fields manually. I'm not sure if there is a better way
# to do this natively in pydantic...
- d = self.model_dump(mode="json", exclude={"elapsed"})
+ d = self.model_dump(mode="json", exclude_computed_fields=True)
return json.dumps(d)
def model_dump_mysql(self) -> dict[str, Any]:
# Generate a dictionary representation of the model, with special handling for datetimes
- d = self.model_dump(mode="json", exclude={"elapsed"})
+ d = self.model_dump(mode="json", exclude_computed_fields=True)
d["started"] = self.started.replace(tzinfo=None)
if self.finished:
d["finished"] = self.finished.replace(tzinfo=None)