Fix forms issue in Django 1.6+.
authorJason Stephenson <jason@sigio.com>
Mon, 5 Mar 2018 18:59:50 +0000 (13:59 -0500)
committerJason Stephenson <jason@sigio.com>
Mon, 5 Mar 2018 19:14:02 +0000 (14:14 -0500)
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 <jason@sigio.com>
conifer/syrup/admin.py

index 608c0ec..18e5fb9 100644 (file)
@@ -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