Fixes #7601: Correct devices count for locations within global search results

This commit is contained in:
jeremystretch
2021-10-27 10:10:14 -04:00
parent 7a7c9827ea
commit e7fcf9962f
2 changed files with 8 additions and 1 deletions

View File

@@ -69,7 +69,13 @@ SEARCH_TYPES = OrderedDict((
}),
('location', {
'queryset': Location.objects.add_related_count(
Location.objects.all(),
Location.objects.add_related_count(
Location.objects.all(),
Device,
'location',
'device_count',
cumulative=True
),
Rack,
'location',
'rack_count',