Fixes: 1) Ensure get_parameters handles missing configuration keys gracefully by adding a check for None values;

Extra: Update `cache.get` default value in `get_parameters` method for better safety.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-10-14 19:48:46 +03:00
parent 20b4efec90
commit e7a859ad0a

View file

@ -139,10 +139,12 @@ def get_project_parameters() -> Any:
configuration source, formats their keys to lowercase, and then stores configuration source, formats their keys to lowercase, and then stores
them in the cache for a limited period. them in the cache for a limited period.
""" """
parameters = cache.get("parameters") parameters = cache.get("parameters", {})
if not parameters: if not parameters:
for key in EXPOSABLE_KEYS: for key in EXPOSABLE_KEYS:
if not getattr(config, key):
continue
parameters[key.lower()] = getattr(config, key) parameters[key.lower()] = getattr(config, key)
cache.set("parameters", parameters, 60 * 60) cache.set("parameters", parameters, 60 * 60)