aboutsummaryrefslogtreecommitdiff
path: root/jb/models/assignment.py
diff options
context:
space:
mode:
authorMax Nanis2026-09-10 01:00:39 -0700
committerMax Nanis2026-09-10 01:00:39 -0700
commit4dca7296742b607e74f16e2f6484c51163a41ace (patch)
tree0839c16d0905deb587d3ee25ff93fd3ccf7eeeb6 /jb/models/assignment.py
parent832aecaddce80e312095ecdb572d7756eb9df5e9 (diff)
downloadamt-jb-4dca7296742b607e74f16e2f6484c51163a41ace.tar.gz
amt-jb-4dca7296742b607e74f16e2f6484c51163a41ace.zip
using model_validator on GRLSettings. Allows null default values, then to asser them on load. Required so pydantic_settings can be loaded in tests without params
Diffstat (limited to 'jb/models/assignment.py')
-rw-r--r--jb/models/assignment.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/jb/models/assignment.py b/jb/models/assignment.py
index 775cd63..1f7033d 100644
--- a/jb/models/assignment.py
+++ b/jb/models/assignment.py
@@ -1,4 +1,3 @@
-import logging
from datetime import datetime, timezone
from typing import Any, TypedDict
from xml.etree import ElementTree
@@ -15,6 +14,7 @@ from pydantic import (
)
from typing_extensions import Self
+from jb.decorators import LOG
from jb.models.custom_types import AMTBoto3ID, AwareDatetimeISO, UUIDStr
from jb.models.definitions import AssignmentStatus
@@ -140,7 +140,8 @@ class Assignment(AssignmentStub):
values["tsid"] = TypeAdapter(UUIDStr).validate_python(tsid)
except ValidationError as e:
# Don't break the model validation if a baddie messes with the tsid in the answer.
- logging.warning(e)
+ LOG.warning(e)
+
values["tsid"] = None
return values