Skip to content

Commit

Permalink
Change the pivot to use slug as name could have special characters th… (
Browse files Browse the repository at this point in the history
  • Loading branch information
itdependsnetworks authored Aug 20, 2022
1 parent 2749bf5 commit 61c7328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nautobot_golden_config/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def __init__(self, *args, **kwargs):
# well as not as expected from user standpoint (e.g. not always the same values on columns depending on
# filtering)
features = list(
models.ConfigCompliance.objects.order_by("rule__feature__name")
.values_list("rule__feature__name", flat=True)
models.ConfigCompliance.objects.order_by("rule__feature__slug")
.values_list("rule__feature__slug", flat=True)
.distinct()
)
extra_columns = [(feature, ComplianceColumn(verbose_name=feature)) for feature in features]
Expand Down
2 changes: 1 addition & 1 deletion nautobot_golden_config/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def alter_queryset(self, request):
return pivot(
self.queryset,
["device", "device__name"],
"rule__feature__name",
"rule__feature__slug",
"compliance_int",
aggregation=Max,
)
Expand Down

0 comments on commit 61c7328

Please sign in to comment.