From 07696d8050f0b1a899adbca5a3d66c98ebf987dc Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 16 Sep 2020 19:56:07 +0200 Subject: [PATCH] Add an inline to view and edit organisation emalis The ability to do this was lost when we moved to multiple emails per organisation since it's no longer in the main table, so add it back as an inline. --- pgweb/core/admin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pgweb/core/admin.py b/pgweb/core/admin.py index 99e397e3..f5aadfe0 100644 --- a/pgweb/core/admin.py +++ b/pgweb/core/admin.py @@ -2,6 +2,7 @@ from django import forms from django.contrib import admin from pgweb.core.models import Version, OrganisationType, Organisation +from pgweb.core.models import OrganisationEmail from pgweb.core.models import ImportedRSSFeed, ImportedRSSItem from pgweb.core.models import ModerationNotification @@ -15,6 +16,10 @@ class OrganisationAdminForm(forms.ModelForm): super(OrganisationAdminForm, self).__init__(*args, **kwargs) +class OrganisationEmailInline(admin.TabularInline): + model = OrganisationEmail + + class OrganisationAdmin(admin.ModelAdmin): form = OrganisationAdminForm list_display = ('name', 'approved', 'lastconfirmed',) @@ -22,6 +27,9 @@ class OrganisationAdmin(admin.ModelAdmin): ordering = ('name', ) search_fields = ('name', ) autocomplete_fields = ['managers', ] + inlines = [ + OrganisationEmailInline, + ] class VersionAdmin(admin.ModelAdmin): -- 2.39.5