Commit 9b5cd294 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'fix/filter-committee-memberships' into 'master'

Filter the inline committee memberships

Closes #439

See merge request !655
parents c939274d fc856804
......@@ -19,7 +19,8 @@ class CommitteeMembershipInlineFormSet(BaseInlineFormSet):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.queryset = self.queryset.select_related('member', 'committee')
self.queryset = self.queryset.select_related(
'member', 'committee').filter(until=None)
class CommitteeMembershipInline(admin.StackedInline):
......@@ -28,8 +29,7 @@ class CommitteeMembershipInline(admin.StackedInline):
can_delete = False
ordering = ('since',)
extra = 0
# TODO: replace this with `autocomplete_fields` in Django 2.0
raw_id_fields = ('member',)
autocomplete_fields = ('member',)
class CommitteeForm(ModelForm):
......
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