Skip to content

Commit 70f4d87

Browse files
committed
cleanup
1 parent f36ea9f commit 70f4d87

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/settings-library/tests/test__pydantic_settings.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"""
1414

1515

16-
from models_library.utils.common_validators import null_or_none_str_to_none_validator
1716
from pydantic import BaseSettings, validator
1817
from pydantic.fields import ModelField, Undefined
1918
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
@@ -52,8 +51,8 @@ class Settings(BaseSettings):
5251
@classmethod
5352
def _parse_none(cls, v, values, field: ModelField):
5453
# WARNING: In nullable fields, envs equal to null or none are parsed as None !!
55-
if field.allow_none:
56-
return null_or_none_str_to_none_validator(v)
54+
if field.allow_none and isinstance(v, str) and v.lower() in ("null", "none"):
55+
return None
5756
return v
5857

5958

0 commit comments

Comments
 (0)