Clearing the ordering of a table does not clear the ordering key from the UserConfig data #8201

Closed
opened 2025-12-29 20:33:44 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jun 15, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.5.3

Python version

3.8

Steps to Reproduce

  1. Open the sites list and order the entries by name.
  2. In a shell, retrieve the UserConfig instance for your user and inspect the entry for tables.SiteTable.ordering:
>>> uc=UserConfig.objects.get(user__username='admin')
>>> uc.data['tables']['SiteTable']['ordering']
['name']
  1. In the UI, clear the applied ordering by clicking the X in the column header.
  2. Refresh and re-inspect the UserConfig data:
>>> uc.refresh_from_db()
>>> uc.data['tables']['SiteTable']['ordering']
['']

Expected Behavior

The ordering key should be removed from the data, as there is no longer any preference stored.

Observed Behavior

ordering is set to a list containing an empty string. This does not effect any breaking behavior AFAICT, however it should be cleaned up as it can pose complications.

Originally created by @jeremystretch on GitHub (Jun 15, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.5.3 ### Python version 3.8 ### Steps to Reproduce 1. Open the sites list and order the entries by name. 2. In a shell, retrieve the UserConfig instance for your user and inspect the entry for `tables.SiteTable.ordering`: ``` >>> uc=UserConfig.objects.get(user__username='admin') >>> uc.data['tables']['SiteTable']['ordering'] ['name'] ``` 3. In the UI, clear the applied ordering by clicking the X in the column header. 4. Refresh and re-inspect the UserConfig data: ``` >>> uc.refresh_from_db() >>> uc.data['tables']['SiteTable']['ordering'] [''] ``` ### Expected Behavior The `ordering` key should be removed from the data, as there is no longer any preference stored. ### Observed Behavior `ordering` is set to a list containing an empty string. This does not effect any breaking behavior AFAICT, however it should be cleaned up as it can pose complications.
adam added the type: bugstatus: accepted labels 2025-12-29 20:33:44 +01:00
adam closed this issue 2025-12-29 20:33:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8201