Some style fixes

This commit is contained in:
Donkie
2025-06-08 12:00:10 +02:00
parent 77aa955766
commit 0b9b3e7391
2 changed files with 23 additions and 10 deletions

View File

@@ -210,6 +210,7 @@ def is_debug_mode() -> bool:
return True
raise ValueError(f"Failed to parse SPOOLMAN_DEBUG_MODE variable: Unknown debug mode '{debug_mode}'.")
def is_cors_defined() -> bool:
"""Get whether CORS is enabled from environment variables.
@@ -221,10 +222,8 @@ def is_cors_defined() -> bool:
"""
cors = os.getenv("SPOOLMAN_CORS_ORIGIN", "FALSE").upper()
if cors in {"FALSE", "0"}:
return False
else:
return True
return cors not in {"FALSE", "0"}
def get_cors_origin() -> Optional[list[str]]:
"""Get the CORS origin from environment variables.
@@ -240,6 +239,7 @@ def get_cors_origin() -> Optional[list[str]]:
return None
return cors.split(",")
def is_automatic_backup_enabled() -> bool:
"""Get whether automatic backup is enabled from environment variables.