Commit c1b60e86 authored by rgaudin's avatar rgaudin
Browse files

Fixed conflict between favicon and logo if both have same name in JSON file

parent d2f74948
......@@ -4,6 +4,7 @@
* Safer JSON import
* Fixed etcher-cli log display on macOS
* Added http://version.<name>.hotspot to display Kiwix Hotspot version on Plug
* Fixed conflict between favicon and logo if both have same name in JSON file
2.0-rc13
* Updated Wikifundi language packs (2018-10-24)
......
......@@ -57,14 +57,13 @@ def set_config(config, args):
# branding files
if "branding" in config.keys() and isinstance(config["branding"], dict):
folder = tempfile.mkdtemp()
for key in ("logo", "favicon", "css"):
if config["branding"].get(key) is not None:
try:
fpath = b64decode(
fname=config["branding"][key]["fname"],
data=config["branding"][key]["data"],
to=folder,
to=tempfile.mkdtemp(),
)
except Exception:
pass
......
......@@ -1311,14 +1311,13 @@ class Application:
# branding
if "branding" in config.keys() and isinstance(config["branding"], dict):
folder = tempfile.mkdtemp()
for key in ("logo", "favicon", "css"):
if config["branding"].get(key) is not None:
try:
fpath = b64decode(
fname=config["branding"][key]["fname"],
data=config["branding"][key]["data"],
to=folder,
to=tempfile.mkdtemp(),
)
except Exception:
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment