Skip to content

Commit 77307b3

Browse files
pheusjeremystretch
authored andcommitted
fix(users): Disable sorting on Permission flag columns
Mark `can_view`, `can_add`, `can_change`, and `can_delete` columns in the Permissions list as `orderable=False`. Sorting by these computed flags persisted an invalid sort key which triggers a `FieldError` when loading `/users/permissions/`. Fixes #20655
1 parent aa4571b commit 77307b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

netbox/users/tables.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,19 @@ class ObjectPermissionTable(NetBoxTable):
8484
)
8585
can_view = columns.BooleanColumn(
8686
verbose_name=_('Can View'),
87+
orderable=False,
8788
)
8889
can_add = columns.BooleanColumn(
8990
verbose_name=_('Can Add'),
91+
orderable=False,
9092
)
9193
can_change = columns.BooleanColumn(
9294
verbose_name=_('Can Change'),
95+
orderable=False,
9396
)
9497
can_delete = columns.BooleanColumn(
9598
verbose_name=_('Can Delete'),
99+
orderable=False,
96100
)
97101
custom_actions = columns.ArrayColumn(
98102
verbose_name=_('Custom Actions'),

0 commit comments

Comments
 (0)