Skip to content

Commit

Permalink
Merge pull request #793 from SuffolkLITLab/actions/black/for_main
Browse files Browse the repository at this point in the history
Format Python code with psf/black push
  • Loading branch information
nonprofittechy authored Nov 15, 2023
2 parents cfa5de4 + 4b8bc58 commit 44ca1af
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docassemble/AssemblyLine/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,11 @@ def is_valid_json(json_string: str) -> bool:
return False
return True

def config_with_language_fallback(config_key:str, top_level_config_key:Optional[str]=None) -> Optional[str]:
"""Returns the value of a config key under `assembly line` `interview list` with options to fallback

def config_with_language_fallback(
config_key: str, top_level_config_key: Optional[str] = None
) -> Optional[str]:
"""Returns the value of a config key under `assembly line` `interview list` with options to fallback
to an alternative key at the top level of the global configuration.
Used in interview_list.yml to allow overriding some of the labels in the interview list
Expand All @@ -1296,7 +1299,7 @@ def config_with_language_fallback(config_key:str, top_level_config_key:Optional[
Returns:
str: The value of the config key, or the alternative key, or None.
"""
interview_list_config = get_config("assembly line",{}).get("interview list",{})
interview_list_config = get_config("assembly line", {}).get("interview list", {})
if interview_list_config.get(config_key):
if isinstance(interview_list_config.get(config_key), dict):
if get_language() in interview_list_config.get(config_key):
Expand All @@ -1306,4 +1309,4 @@ def config_with_language_fallback(config_key:str, top_level_config_key:Optional[
else:
return interview_list_config.get(config_key)
else:
return get_config(top_level_config_key or config_key)
return get_config(top_level_config_key or config_key)

0 comments on commit 44ca1af

Please sign in to comment.