implement explicit removal of non-present keys

This commit is contained in:
Jakob Ketterl 2021-02-23 00:12:22 +01:00
parent 679f99d701
commit 436010ffe3

View File

@ -443,6 +443,14 @@ class OptionalSection(Section):
input.setDisabled() input.setDisabled()
return super().render(data) 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): class SdrDeviceDescription(object):
@staticmethod @staticmethod