From 436010ffe3df05e049ecce9625f5483026c74987 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 23 Feb 2021 00:12:22 +0100 Subject: [PATCH] implement explicit removal of non-present keys --- owrx/source/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 435fd41..b062bb7 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -443,6 +443,14 @@ class OptionalSection(Section): input.setDisabled() return super().render(data) + def parse(self, data): + data = super().parse(data) + # remove optional keys if they have been removed from the form + for k in self.optional: + if k not in data: + data[k] = None + return data + class SdrDeviceDescription(object): @staticmethod