Commit 4609a0d
committed
fix: update model_validator to use instance method signature
Pydantic v2.12 deprecated using @model_validator(mode='after') with a
classmethod-style signature (cls, values). This change updates the
_validate_credentials method to use the correct instance method signature
(self), which:
- Eliminates the deprecation warning
- Uses direct attribute access (self.username) instead of dict access
- Returns self instead of values
This is a non-breaking change that maintains the same validation logic
while conforming to Pydantic v2.12+ best practices.
Fixes deprecation warning:
'Using @model_validator with mode="after" on a classmethod is deprecated'1 parent b8d7562 commit 4609a0d
1 file changed
+7
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
| 48 | + | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| |||
0 commit comments