We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae52c60 commit 60c2f2cCopy full SHA for 60c2f2c
confit/registry.py
@@ -218,10 +218,10 @@ def validate_arguments(
218
def validate(_func: Callable) -> Callable:
219
if isinstance(_func, type):
220
_func: type
221
- if hasattr(_func.__init__, "__wrapped__"):
222
- vd = ValidatedFunction(_func.__init__.__wrapped__, config)
223
- else:
224
- vd = ValidatedFunction(_func.__init__, config)
+ vd = _func.__init__
+ while hasattr(vd, "__wrapped__"):
+ vd = vd.__wrapped__
+ vd = ValidatedFunction(vd, config)
225
vd.model.__name__ = _func.__name__
226
if PYDANTIC_V1:
227
vd.model.__fields__["self"].default = None
0 commit comments