Skip to content

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

@jeremystretch

Description

@jeremystretch

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.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions