File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ def get_setting(key):
197197
198198# -------------------------------------------------------------------------------
199199# Return setting value
200- def get_setting_value (key ):
200+ def get_setting_value (key , default = "" ):
201201 """
202202 Retrieve a setting value from configuration.
203203
@@ -208,13 +208,16 @@ def get_setting_value(key):
208208
209209 Args:
210210 key (str): The setting key to look up.
211+ default (Any): Value to return when the key is not found. Defaults
212+ to "" for backwards compatibility with call sites that already
213+ treat an empty string as "missing".
211214
212215 Returns:
213- Any: The Python-typed setting value, or an empty string if not found.
216+ Any: The Python-typed setting value, or `default` if not found.
214217 """
215218
216- # Returns empty string if not found
217- value = ""
219+ # Returns default if not found
220+ value = default
218221
219222 # lookup key in secondary cache
220223 if key in SETTINGS_SECONDARYCACHE :
You can’t perform that action at this time.
0 commit comments