Add additional addon admin filters (#20341)

This commit is contained in:
Mathieu Pillard 2023-02-14 16:18:58 +01:00 коммит произвёл GitHub
Родитель 98cd287f52
Коммит 990e1af37a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -192,8 +192,20 @@ class AddonAdmin(AMOModelAdmin):
'reviewer_flags', 'reviewer_flags',
) )
list_filter = ( list_filter = (
(
'created',
DateRangeFilter,
),
'type', 'type',
'status', 'status',
(
'addonuser__user__created',
DateRangeFilter,
),
(
'addonuser__user__banned',
admin.EmptyFieldListFilter,
),
( (
'reviewerflags__auto_approval_disabled', 'reviewerflags__auto_approval_disabled',
admin.BooleanFieldListFilter, admin.BooleanFieldListFilter,
@ -350,6 +362,9 @@ class AddonAdmin(AMOModelAdmin):
] ]
return custom_urlpatterns + urlpatterns return custom_urlpatterns + urlpatterns
def get_rangefilter_addonuser__user__created_title(self, request, field_path):
return 'author created'
def authors_links(self, obj): def authors_links(self, obj):
# Note: requires .transform(Addon.attach_all_authors) to have been # Note: requires .transform(Addon.attach_all_authors) to have been
# applied to fill all_authors property and role on each user in it. # applied to fill all_authors property and role on each user in it.