removeEmtpy sting as helper fn

This commit is contained in:
Tiago vasconcelos 2022-03-22 11:36:04 +00:00 committed by dni ⚡
parent edfa98f00e
commit ba6bda39ab

View File

@ -154,8 +154,20 @@ def url_for(endpoint: str, external: Optional[bool] = False, **params: Any) -> s
url = f"{base}{endpoint}{url_params}"
return url
def removeEmptyString(arr):
return list(filter(None, arr))
def template_renderer(additional_folders: List = []) -> Jinja2Templates:
if(settings.LNBITS_ADMIN_UI):
_ = g().admin_conf
settings.LNBITS_AD_SPACE = _.ad_space
settings.LNBITS_HIDE_API = _.hide_api
settings.LNBITS_SITE_TITLE = _.site_title
settings.LNBITS_DENOMINATION = _.denomination
settings.LNBITS_SITE_TAGLINE = _.site_tagline
settings.LNBITS_SITE_DESCRIPTION = _.site_description
settings.LNBITS_THEME_OPTIONS = _.theme
t = Jinja2Templates(
loader=jinja2.FileSystemLoader(
["lnbits/templates", "lnbits/core/templates", *additional_folders]