Commit 296e90a7 authored by Tom van Bussel's avatar Tom van Bussel
Browse files

List each member only once in Registration admin

Previously `Member`s with multiple `Membership`s were listed
parent 94cbc4be
......@@ -182,4 +182,6 @@ class RegistrationAdmin(DoNextModelAdmin):
if request.GET.get('event_pk'):
kwargs['queryset'] = models.Event.objects.filter(
elif == 'member':
kwargs['queryset'] = Member.active_members.all()
return super().formfield_for_foreignkey(db_field, request, **kwargs)
......@@ -24,7 +24,8 @@ class ActiveMemberManager(models.Manager):
return (super().get_queryset()
.filter(Q(user__membership__until__isnull=True) |
def with_birthdays_in_range(self, from_date, to_date):
queryset = self.get_queryset().filter(birthday__lte=to_date)
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