Skip to content

Commit 615a0a9

Browse files
committed
Fix Pydantic deprecations
1 parent 8bb4553 commit 615a0a9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/pato/models/alerts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ class NotificationSignup(BaseModel):
6767
email: EmailStr
6868

6969
@model_validator(mode="after")
70-
def check_max_greater_than_min(cls, data):
70+
def check_max_greater_than_min(self):
7171
for field in ALERT_FIELDS:
72-
max_value = getattr(data, field + "Max")
73-
min_value = getattr(data, field + "Min")
72+
max_value = getattr(self, field + "Max")
73+
min_value = getattr(self, field + "Min")
7474
assert (
7575
min_value is None or max_value is None or max_value > min_value
7676
), f"{field}Max must be greater than {field}Min"
7777

78-
return data
78+
return self

src/pato/models/reprocessing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def filter_model(self, filter: list[str]):
6868
return self
6969

7070
@model_validator(mode="before")
71+
@classmethod
7172
def empty_string_to_none(cls, values):
7273
for key, value in values.items():
7374
if value == "":

0 commit comments

Comments
 (0)