add exception for uploaded images

This commit is contained in:
Jakob Ketterl 2021-02-08 23:44:10 +01:00
parent 16d0e1a0d7
commit ad5daaae95
1 changed files with 5 additions and 0 deletions

View File

@ -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)