From 59c3f552821fe2037648a6bd24f4e53470ba2742 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 17 Dec 2024 11:08:54 +0100 Subject: [PATCH] Fix related `modules` in device history search --- python/nav/web/devicehistory/utils/history.py | 4 ++-- python/nav/web/devicehistory/views.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/nav/web/devicehistory/utils/history.py b/python/nav/web/devicehistory/utils/history.py index 989477e78c..13a95feb08 100644 --- a/python/nav/web/devicehistory/utils/history.py +++ b/python/nav/web/devicehistory/utils/history.py @@ -90,7 +90,7 @@ def make_selection_filter(and_mode=False): 'room__location', 'organization', 'category', - 'module', + 'modules', 'groups', ) if selection[arg] @@ -125,7 +125,7 @@ def make_selection_filter(and_mode=False): # Find device ids that belongs to # - selected devices - device = Device.objects.filter(modules__in=selection['module']) + device = Device.objects.filter(modules__in=selection['modules']) # Find alert history that belongs to the netbox and device ids we found in # the previous two queries. diff --git a/python/nav/web/devicehistory/views.py b/python/nav/web/devicehistory/views.py index 1641308440..cb5f283f2e 100644 --- a/python/nav/web/devicehistory/views.py +++ b/python/nav/web/devicehistory/views.py @@ -110,7 +110,7 @@ def devicehistory_view(request, **_): 'room': request.GET.getlist('room'), 'netbox': request.GET.getlist('netbox'), 'groups': request.GET.getlist('netboxgroup'), - 'module': request.GET.getlist('module'), + 'modules': request.GET.getlist('module'), 'mode': request.GET.getlist('mode'), }