mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Further mutable-default fix to template-renderer
This commit is contained in:
parent
87d50243e2
commit
be1e1453da
|
@ -3,7 +3,7 @@ Jinja2 rendering utils, used to generate new strategy and configurations.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from typing import Dict
|
from typing import Dict, Optional
|
||||||
|
|
||||||
|
|
||||||
def render_template(templatefile: str, arguments: Dict) -> str:
|
def render_template(templatefile: str, arguments: Dict) -> str:
|
||||||
|
@ -19,11 +19,13 @@ def render_template(templatefile: str, arguments: Dict) -> str:
|
||||||
|
|
||||||
|
|
||||||
def render_template_with_fallback(templatefile: str, templatefallbackfile: str,
|
def render_template_with_fallback(templatefile: str, templatefallbackfile: str,
|
||||||
arguments: dict = {}) -> str:
|
arguments: Optional[Dict] = None) -> str:
|
||||||
"""
|
"""
|
||||||
Use templatefile if possible, otherwise fall back to templatefallbackfile
|
Use templatefile if possible, otherwise fall back to templatefallbackfile
|
||||||
"""
|
"""
|
||||||
from jinja2.exceptions import TemplateNotFound
|
from jinja2.exceptions import TemplateNotFound
|
||||||
|
if arguments is None:
|
||||||
|
arguments = {}
|
||||||
try:
|
try:
|
||||||
return render_template(templatefile, arguments)
|
return render_template(templatefile, arguments)
|
||||||
except TemplateNotFound:
|
except TemplateNotFound:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user