From faab81c7ab209d5c0ed095a6b456200866d66621 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 10 Apr 2025 16:27:42 -0400 Subject: [PATCH] Fix ordering validation to account for leading hyphens --- netbox/extras/models/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netbox/extras/models/models.py b/netbox/extras/models/models.py index a34261342..d0bb5af6e 100644 --- a/netbox/extras/models/models.py +++ b/netbox/extras/models/models.py @@ -626,6 +626,8 @@ class TableConfig(CloningMixin, ChangeLoggedModel): # Validate ordering columns for name in self.ordering: + if name.startswith('-'): + name = name[1:] # Strip leading hyphen if name not in table.columns: raise ValidationError({ 'ordering': _('Unknown column: {name}').format(name=name)