From 1e515062d52fb716149c12ac1ab0d2ff6baf8fad Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 29 Oct 2023 23:44:44 +0100 Subject: [PATCH] feat: Handle missing keys in generator configs --- app/generator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/generator.py b/app/generator.py index 90d5703..2bf29f8 100644 --- a/app/generator.py +++ b/app/generator.py @@ -3,7 +3,6 @@ from app import api from app.utils import get_repository_name, to_json, write_json, read_json, create_if_not_exists from abc import abstractmethod - class Generator: _api: api.Api @@ -137,8 +136,8 @@ class DonationsGenerator(Generator): super().__init__("donations", api) def generate(self, config, path): - donation_links = config["links"] - donation_wallets = config["wallets"] + donation_links = config["links"] if "links" in config else [] + donation_wallets = config["wallets"] if "wallets" in config else [] donation_path = join(path, f"donations.json")