Skip to content

Commit

Permalink
fix: no Optional when min_py is not higher than 3.10 (#804)
Browse files Browse the repository at this point in the history
Co-authored-by: Zhang Fengping <[email protected]>
  • Loading branch information
fpzhang928 and Zhang Fengping authored Nov 20, 2024
1 parent 42c6f78 commit f7686f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions template/src/{{ module_name }}/settings.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ class GlobalSettings(BaseSettings):
class Settings(BaseSettings):
"""Project specific settings."""

[%- if not version_higher_than(min_py, "3.10") %]

logging_level: Optional[str] = getLevelName(logging.INFO)

[%- else %]

logging_level: str | None = getLevelName(logging.INFO)
[%- endif %]
"""Default logging level for the project."""

model_config = SettingsConfigDict(
Expand Down

0 comments on commit f7686f3

Please sign in to comment.