X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e24e657ebf536f55c1bde66bd41563fae30a98b0..2954f0e21a4c9adf96bb63c85339e7fa79d78e22:/src/club/admin.py?ds=inline diff --git a/src/club/admin.py b/src/club/admin.py index 7b526fcd4..fc715e2cd 100644 --- a/src/club/admin.py +++ b/src/club/admin.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import json from django.contrib import admin @@ -67,6 +67,12 @@ class ExpiredFilter(YesNoFilter): q = Q(expires_at__isnull=False, expires_at__lt=Now()) +class ActiveFilter(YesNoFilter): + title = 'płatność aktualna' + parameter_name = 'active' + q = Q(expires_at__gt=Now()) + + class ScheduleForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -111,7 +117,7 @@ class ScheduleAdmin(admin.ModelAdmin): search_fields = ['email', 'source'] list_filter = [ 'is_cancelled', 'monthly', 'yearly', 'method', - PayedFilter, ExpiredFilter, + PayedFilter, ActiveFilter, ExpiredFilter, SourceFilter, ] filter_horizontal = ['consent']