aboutsummaryrefslogtreecommitdiff
path: root/generalresearch/managers/thl/profiling/uqa.py
diff options
context:
space:
mode:
Diffstat (limited to 'generalresearch/managers/thl/profiling/uqa.py')
-rw-r--r--generalresearch/managers/thl/profiling/uqa.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/generalresearch/managers/thl/profiling/uqa.py b/generalresearch/managers/thl/profiling/uqa.py
index cbe39e7..d240eea 100644
--- a/generalresearch/managers/thl/profiling/uqa.py
+++ b/generalresearch/managers/thl/profiling/uqa.py
@@ -2,14 +2,17 @@ from __future__ import annotations
import logging
from collections.abc import Collection
-from datetime import datetime, timedelta, timezone
+from datetime import UTC, datetime, timedelta
+from typing import TYPE_CHECKING
from generalresearch.managers.base import PostgresManagerWithRedis
from generalresearch.models.thl.profiling.user_question_answer import (
DUMMY_UQA,
UserQuestionAnswer,
)
-from generalresearch.models.thl.user import User
+
+if TYPE_CHECKING:
+ from generalresearch.models.thl.user import User
logger = logging.getLogger()
@@ -128,7 +131,7 @@ class UQAManager(PostgresManagerWithRedis):
def get_from_db(self, user: User) -> list[UserQuestionAnswer]:
logger.info(f"get_uqa_from_db: {user.user_id}")
# Only store the latest row per question_id. We don't need it multiple times.
- since = datetime.now(tz=timezone.utc) - timedelta(days=30)
+ since = datetime.now(tz=UTC) - timedelta(days=30)
# We CAN use the RR, b/c either
# 1) the cache expired and the user hasn't sent an answer recently