Skip to content

Commit

Permalink
Config: Handle default factories in config generation
Browse files Browse the repository at this point in the history
Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Sep 16, 2024
1 parent 3340c3b commit b6dd21f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/config_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ def generate_config_file(
else:
sub_iter_once = True

value = subfield_data.default
if subfield_data.default_factory:
value = subfield_data.default_factory()
else:
value = subfield_data.default

value = value if value is not None else ""
value = value if value is not PydanticUndefined else ""

Expand Down

0 comments on commit b6dd21f

Please sign in to comment.