Просмотр исходного кода

Fixes #5091: Avoid KeyError when handling invalid table preferences

Jeremy Stretch 5 лет назад
Родитель
Сommit
b559c827d2
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      docs/release-notes/version-2.9.md
  2. 1 1
      netbox/utilities/tables.py

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -15,6 +15,7 @@
 * [#5085](https://github.com/netbox-community/netbox/issues/5085) - Fix ordering by assignment in IP addresses table
 * [#5087](https://github.com/netbox-community/netbox/issues/5087) - Restore label field when editing console server ports, power ports, and power outlets
 * [#5090](https://github.com/netbox-community/netbox/issues/5090) - Fix status display for console/power/interface connections
+* [#5091](https://github.com/netbox-community/netbox/issues/5091) - Avoid KeyError when handling invalid table preferences
 
 ---
 

+ 1 - 1
netbox/utilities/tables.py

@@ -44,7 +44,7 @@ class BaseTable(tables.Table):
                     self.columns.show(name)
                 else:
                     self.columns.hide(name)
-            self.sequence = columns
+            self.sequence = [c for c in columns if c in self.base_columns]
 
             # Always include PK and actions column, if defined on the table
             if pk: