From b559c827d24059af92779b2988b111da1fc1bbb6 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 2 Sep 2020 13:30:19 -0400 Subject: [PATCH] Fixes #5091: Avoid KeyError when handling invalid table preferences --- docs/release-notes/version-2.9.md | 1 + netbox/utilities/tables.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.9.md b/docs/release-notes/version-2.9.md index 19218732a..f5705bca8 100644 --- a/docs/release-notes/version-2.9.md +++ b/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 --- diff --git a/netbox/utilities/tables.py b/netbox/utilities/tables.py index 0144ea2d1..6df6b2e26 100644 --- a/netbox/utilities/tables.py +++ b/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: