Commit 2db4e3a 1 parent 153058b commit 2db4e3a Copy full SHA for 2db4e3a
File tree 3 files changed +7
-1
lines changed
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1182,6 +1182,7 @@ class ProductFilter(DojoFilter):
1182
1182
('origin' , 'origin' ),
1183
1183
('external_audience' , 'external_audience' ),
1184
1184
('internet_accessible' , 'internet_accessible' ),
1185
+ ('findings_count' , 'findings_count' )
1185
1186
),
1186
1187
field_labels = {
1187
1188
'name' : 'Product Name' ,
@@ -1193,6 +1194,7 @@ class ProductFilter(DojoFilter):
1193
1194
'origin' : 'Origin ' ,
1194
1195
'external_audience' : 'External Audience ' ,
1195
1196
'internet_accessible' : 'Internet Accessible ' ,
1197
+ 'findings_count' : 'Findings Count ' ,
1196
1198
}
1197
1199
1198
1200
)
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ def product(request):
68
68
# see https://code.djangoproject.com/ticket/23771 and https://code.djangoproject.com/ticket/25375
69
69
name_words = prods .values_list ('name' , flat = True )
70
70
71
+ prods = prods .annotate (
72
+ findings_count = Count ('engagement__test__finding' , filter = Q (engagement__test__finding__active = True ))
73
+ )
74
+
71
75
prod_filter = ProductFilter (request .GET , queryset = prods , user = request .user )
72
76
73
77
prod_list = get_page_items (request , prod_filter .qs , 25 )
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ <h3 class="has-filters">
62
62
{% if system_settings.enable_github %}
63
63
< th class ="text-center "> GitHub</ th >
64
64
{% endif %}
65
- < th class ="text-center "> Active (Verified) Findings</ th >
65
+ < th class ="text-center "> {% dojo_sort request ' Active (Verified) Findings' 'findings_count' %} </ th >
66
66
< th class ="text-center "> Vulnerable Hosts / Endpoints</ th >
67
67
< th > Contact</ th >
68
68
{% comment %} The display field is translated in the function. No need to translate here as well{% endcomment %}
You can’t perform that action at this time.
0 commit comments