Commit d02c5b31 authored by Elger Jonker's avatar Elger Jonker

Adds country filters on UrlRatings, and orders them correctly


Former-commit-id: 8bbe5e2115577c73e723388c8aaf06b1fe202690 [formerly 282ad18a]
Former-commit-id: efa78d16
parent d79c3f90
......@@ -21,7 +21,7 @@ class OrganizationRatingAdmin(ImportExportModelAdmin, admin.ModelAdmin):
list_display = ('organization', 'high', 'medium', 'low', 'when', 'inspect_organization')
search_fields = (['organization__name', 'rating', 'high', 'medium', 'low', 'when', 'calculation'])
list_filter = ('organization', 'organization__country', 'organization__type__name', 'rating', 'when')
list_filter = ['organization', 'organization__country', 'organization__type__name', 'rating', 'when'][::-1]
fields = ('organization', 'total_urls', 'total_endpoints',
'high',
'medium',
......@@ -75,7 +75,7 @@ class UrlRatingAdmin(ImportExportModelAdmin, admin.ModelAdmin):
list_display = ('url', 'high', 'medium', 'low', 'total_endpoints', 'when', 'inspect_url')
search_fields = (['url__organization__name', 'rating', 'high', 'medium', 'low', 'when', 'calculation'])
list_filter = ('url', 'rating', 'when')
list_filter = ['url', 'rating', 'when', 'url__organization__type', 'url__organization__country'][::-1]
fields = ('url', 'total_endpoints',
'total_issues',
......@@ -122,7 +122,7 @@ class AdministrativeRegionAdmin(ImportExportModelAdmin, admin.ModelAdmin):
list_display = ('country', 'organization_type', 'admin_level', 'imported')
search_fields = (['country', 'organization_type', 'admin_level'])
list_filter = ('country', 'organization_type', 'admin_level', 'imported')
list_filter = ['country', 'organization_type', 'admin_level', 'imported'][::-1]
fields = ('country', 'organization_type', 'admin_level', 'imported')
actions = []
......@@ -180,7 +180,8 @@ class ConfigurationAdmin(SortableAdminMixin, ImportExportModelAdmin, admin.Model
list_display = ('country', 'organization_type', 'is_displayed', 'is_the_default_option', 'is_scanned',
'is_reported')
search_fields = (['country', 'organization_type', ])
list_filter = ('country', 'organization_type', 'is_displayed', 'is_the_default_option', 'is_scanned', 'is_reported')
list_filter = ['country', 'organization_type', 'is_displayed', 'is_the_default_option',
'is_scanned', 'is_reported'][::-1]
fields = ('country', 'organization_type', 'is_displayed', 'is_the_default_option', 'is_scanned', 'is_reported')
actions = []
......@@ -261,14 +262,14 @@ class ConfigurationAdmin(SortableAdminMixin, ImportExportModelAdmin, admin.Model
@admin.register(VulnerabilityStatistic)
class VulnerabilityStatisticAdmin(ImportExportModelAdmin, admin.ModelAdmin):
list_display = ('country', 'organization_type', 'scan_type', 'when', 'high', 'medium', 'low', 'urls', 'endpoints')
list_filter = ('country', 'organization_type', 'scan_type', 'when', 'high', 'medium', 'low')
list_filter = ['country', 'organization_type', 'scan_type', 'when', 'high', 'medium', 'low'][::-1]
search_fields = (['country', 'organization_type', 'scan_type'])
@admin.register(MapDataCache)
class MapDataCacheAdmin(ImportExportModelAdmin, admin.ModelAdmin):
list_display = ('pk', 'country', 'organization_type', 'filters', 'when', 'length')
list_filter = ('country', 'organization_type', 'filters', 'when')
list_filter = ['country', 'organization_type', 'filters', 'when'][::-1]
search_fields = (['country', 'organization_type', 'filters'])
readonly_fields = ['cached_on']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment