Skip to content

Commit f7686f3

Browse files
fpzhang928Zhang Fengping
andauthored
fix: no Optional when min_py is not higher than 3.10 (#804)
Co-authored-by: Zhang Fengping <[email protected]>
1 parent 42c6f78 commit f7686f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

template/src/{{ module_name }}/settings.py.jinja

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ class GlobalSettings(BaseSettings):
2020
class Settings(BaseSettings):
2121
"""Project specific settings."""
2222

23+
[%- if not version_higher_than(min_py, "3.10") %]
24+
2325
logging_level: Optional[str] = getLevelName(logging.INFO)
26+
27+
[%- else %]
28+
29+
logging_level: str | None = getLevelName(logging.INFO)
30+
[%- endif %]
2431
"""Default logging level for the project."""
2532

2633
model_config = SettingsConfigDict(

0 commit comments

Comments
 (0)