Commit 8143e661 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'feature/422-mailinglist-search' into 'master'

Add alias searching to mailinglists and show them in the admin overview

Closes #422

See merge request !485
parents 3d5b1d68 e0367428
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from members.models import Member
from .models import ListAlias, MailingList, VerbatimAddress
......@@ -13,7 +14,13 @@ class ListAliasInline(admin.TabularInline):
class GeneralMeetingAdmin(admin.ModelAdmin):
class MailingListAdmin(admin.ModelAdmin):
model = Member
filter_horizontal = ('members',)
inlines = (VerbatimAddressInline, ListAliasInline)
list_display = ('name', 'alias_names',)
search_fields = ['name', 'prefix', 'aliasses__alias']
def alias_names(self, obj):
return [x.alias for x in obj.aliasses.all()]
alias_names.short_description = _('List aliasses')
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