From ad5daaae9558015fa2dbd0aaf8e3d5f4c2a98886 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 8 Feb 2021 23:44:10 +0100 Subject: [PATCH] add exception for uploaded images --- owrx/controllers/assets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/owrx/controllers/assets.py b/owrx/controllers/assets.py index a1468e4..824b344 100644 --- a/owrx/controllers/assets.py +++ b/owrx/controllers/assets.py @@ -90,6 +90,11 @@ class AssetsController(GzipMixin, ModificationAwareController, metaclass=ABCMeta class OwrxAssetsController(AssetsController): def getFilePath(self, file): + config = CoreConfig() + if file == "gfx/openwebrx-avatar.png": + file = config.get_data_directory() + "/receiver_avatar" + if os.path.exists(file) and os.path.isfile(file): + return file return pkg_resources.resource_filename("htdocs", file)