Skip to content

Commit 6173bd2

Browse files
committed
Fix: Pydantic has an issue where default_factory is called even when Validation for a referenced field fails. This prevents a 'KeyNotFound' error from occuring. Fix is WIP by pydantic but not implemented yet.
pydantic/pydantic-core#1623
1 parent e79c46a commit 6173bd2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bpod_rig/config/models/system_settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def system_path_factory(data: dict, addition: str):
2828
-------
2929
(pathlib.Path): combined path in above form
3030
"""
31+
if "base_dir" not in data:
32+
return None
33+
3134
return data["base_dir"].joinpath(addition)
3235

3336
class SystemPaths(SettingsBase):

0 commit comments

Comments
 (0)