Commit c5aeb8da authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg Committed by Luko van der Maas
Browse files

Add filter to get all users without an active membership

parent 7aec1a31
......@@ -36,15 +36,21 @@ class ProfileInline(admin.StackedInline):
class MembershipTypeListFilter(admin.SimpleListFilter):
title = _('membership type')
title = _('current membership type')
parameter_name = 'membership'
def lookups(self, request, model_admin):
return models.Membership.MEMBERSHIP_TYPES
return models.Membership.MEMBERSHIP_TYPES + (('none', _('None')),)
def queryset(self, request, queryset):
if not self.value():
return queryset
if self.value() == 'none':
return queryset.exclude(
~Q(membership=None) & (
Q(membership__until__isnull=True) |
Q(membership__until__gt=timezone.now().date())
))
return (queryset
.exclude(membership=None)
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-31 19:21+0100\n"
"PO-Revision-Date: 2018-10-31 19:20+0100\n"
"POT-Creation-Date: 2018-11-12 19:36+0100\n"
"PO-Revision-Date: 2018-11-12 19:37+0100\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -19,8 +19,12 @@ msgstr ""
"X-Generator: Poedit 2.2\n"
#: admin.py
msgid "membership type"
msgstr "lidtype"
msgid "current membership type"
msgstr "huidig lidtype"
#: admin.py
msgid "None"
msgstr "Geen"
#: admin.py
msgid "Age"
......
Supports Markdown
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