From fbe982af363d3b3df9e7ba947b6761fe2a35bc0b Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 15 Mar 2023 12:26:07 +0200 Subject: [PATCH] fix: assume no pre-installed extensions (#1558) * fix: assume no pre-installed extensions * chore: code format --- lnbits/extension_manager.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lnbits/extension_manager.py b/lnbits/extension_manager.py index 16c438eb8..885a7c5a1 100644 --- a/lnbits/extension_manager.py +++ b/lnbits/extension_manager.py @@ -227,11 +227,7 @@ class InstallableExtension(BaseModel): if not Path(self.ext_dir).is_dir(): return False config_file = os.path.join(self.ext_dir, "config.json") - if not Path(config_file).is_file(): - return False - with open(config_file, "r") as json_file: - config_json = json.load(json_file) - return config_json.get("is_installed") is True + return Path(config_file).is_file() def download_archive(self): logger.info(f"Downloading extension {self.name}.") @@ -275,10 +271,6 @@ class InstallableExtension(BaseModel): os.path.join(self.ext_upgrade_dir, self.id, "config.json"), "r+" ) as json_file: config_json = json.load(json_file) - config_json["is_installed"] = True - json_file.seek(0) - json.dump(config_json, json_file) - json_file.truncate() self.name = config_json.get("name") self.short_description = config_json.get("short_description")