From 990e1af37ad8c5ed15c9426912faca3367329741 Mon Sep 17 00:00:00 2001 From: Mathieu Pillard Date: Tue, 14 Feb 2023 16:18:58 +0100 Subject: [PATCH] Add additional addon admin filters (#20341) --- src/olympia/addons/admin.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/olympia/addons/admin.py b/src/olympia/addons/admin.py index 4d0862e033..c2b823fa9b 100644 --- a/src/olympia/addons/admin.py +++ b/src/olympia/addons/admin.py @@ -192,8 +192,20 @@ class AddonAdmin(AMOModelAdmin): 'reviewer_flags', ) list_filter = ( + ( + 'created', + DateRangeFilter, + ), 'type', 'status', + ( + 'addonuser__user__created', + DateRangeFilter, + ), + ( + 'addonuser__user__banned', + admin.EmptyFieldListFilter, + ), ( 'reviewerflags__auto_approval_disabled', admin.BooleanFieldListFilter, @@ -350,6 +362,9 @@ class AddonAdmin(AMOModelAdmin): ] return custom_urlpatterns + urlpatterns + def get_rangefilter_addonuser__user__created_title(self, request, field_path): + return 'author created' + def authors_links(self, obj): # Note: requires .transform(Addon.attach_all_authors) to have been # applied to fill all_authors property and role on each user in it.