From b465c33e1b863f13dba42330c31e6148920af781 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 13 Nov 2024 15:39:34 -0800 Subject: [PATCH] networks: Fix issue with loading create PPPoE form - The form does not have DNS-over-TLS field and trying to set initial value for it fails. Tests: - Load the PPPoE creation form. Without the patch, it fails with an exception. With the patch it succeeds. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/modules/networks/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plinth/modules/networks/forms.py b/plinth/modules/networks/forms.py index b2dc3f37f..9a6d9467d 100644 --- a/plinth/modules/networks/forms.py +++ b/plinth/modules/networks/forms.py @@ -168,8 +168,9 @@ class ConnectionForm(forms.Form): """Disable DNS fallback field if necessary.""" from plinth.modules import names super().__init__(*args, **kwargs) - self.fields['dns_over_tls'].disabled = ( - not names.is_resolved_installed()) + if 'dns_over_tls' in self.fields: + self.fields['dns_over_tls'].disabled = ( + not names.is_resolved_installed()) @staticmethod def _get_interface_choices(device_type):