From 4a7e3a9efd0e948caf092ce1b10f51ef22a44bac Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Mon, 5 Mar 2018 13:59:50 -0500 Subject: [PATCH] Fix forms issue in Django 1.6+. In Django 1.6, you must explicitly declare that you want to use all fields from the model on a ModelForm. Prior to Django 1.6, this was not necessary. Fixes the following errors: ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form MembershipAdminForm needs updating. ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form UserProfileAdminForm needs updating. Signed-off-by: Jason Stephenson --- conifer/syrup/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conifer/syrup/admin.py b/conifer/syrup/admin.py index 608c0ec..18e5fb9 100644 --- a/conifer/syrup/admin.py +++ b/conifer/syrup/admin.py @@ -19,6 +19,7 @@ class MembershipAdminForm(forms.ModelForm): class Meta: model = Membership + fields = "__all__" class MembershipAdmin(admin.ModelAdmin): search_fields = ['user__username', 'group__external_id', @@ -32,6 +33,7 @@ class UserProfileAdminForm(forms.ModelForm): class Meta: model = UserProfile + fields = "__all__" class UserProfileAdmin(admin.ModelAdmin): form = UserProfileAdminForm -- 2.11.0