Skip to content

Commit

Permalink
fix report graph not matching data, fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkala authored and itdependsnetworks committed Feb 1, 2025
1 parent f9aa441 commit 2c49e70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nautobot_golden_config/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def test_alter_queryset(self):
reverse("plugins:nautobot_golden_config:configcompliance_list")
)
request.user = self.user
queryset = views.ConfigComplianceUIViewSet(request=request).alter_queryset(request)
queryset = views.ConfigComplianceUIViewSet(request=request, action="list").alter_queryset(request)
features = (
models.ComplianceFeature.objects.filter(feature__rule__isnull=False)
.values_list("slug", flat=True)
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 @@ -380,7 +380,7 @@ def setup(self, request, *args, **kwargs):
# Add .restrict() to the queryset to restrict the view based on user permissions.
main_qs = models.ConfigCompliance.objects.restrict(request.user, "view")
device_aggr, feature_aggr = get_global_aggr(main_qs, self.filterset, filter_params)
feature_qs = self.filterset(request.GET, self.queryset).qs
feature_qs = self.filterset(request.GET, self.queryset.restrict(request.user, "view")).qs
self.extra_content = {
"bar_chart": plot_barchart_visual(feature_qs),
"device_aggr": device_aggr,
Expand Down

0 comments on commit 2c49e70

Please sign in to comment.