Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions reflex/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def getenv(self) -> T | None:
The environment variable value.
"""
env_value = os.getenv(self.name, None)
if env_value is not None:
if env_value and env_value.strip():
return self.interpret(env_value)
return None

Expand All @@ -402,7 +402,7 @@ def is_set(self) -> bool:
Returns:
True if the environment variable is set.
"""
return self.name in os.environ
return bool(os.getenv(self.name, "").strip())

def get(self) -> T:
"""Get the interpreted environment variable value or the default value if not set.
Expand Down Expand Up @@ -966,7 +966,7 @@ def update_from_env(self) -> dict[str, Any]:
env_var = os.environ.get(key.upper())

# If the env var is set, override the config value.
if env_var is not None:
if env_var and env_var.strip():
# Interpret the value.
value = interpret_env_var_value(
env_var, true_type_for_pydantic_field(field), field.name
Expand Down
Loading