From 3b894f9ccb6e502573d4bcfa1c4f3f5a2f9dfdb4 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Tue, 25 Feb 2025 06:11:59 -0500 Subject: [PATCH] Handle null table in TableConfigForm --- netbox/utilities/forms/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netbox/utilities/forms/forms.py b/netbox/utilities/forms/forms.py index 0b92ce7b3..301be4886 100644 --- a/netbox/utilities/forms/forms.py +++ b/netbox/utilities/forms/forms.py @@ -132,8 +132,9 @@ class TableConfigForm(forms.Form): super().__init__(*args, **kwargs) # Initialize columns field based on table attributes - self.fields['available_columns'].choices = table.available_columns - self.fields['columns'].choices = table.selected_columns + if table: + self.fields['available_columns'].choices = table.available_columns + self.fields['columns'].choices = table.selected_columns @property def table_name(self):