]> git.parisson.com Git - telemeta.git/commitdiff
Fix ImproperlyConfigured Exception for ModelForm
authorThomas Fillon <thomas@parisson.com>
Tue, 17 Jan 2017 16:52:02 +0000 (17:52 +0100)
committerThomas Fillon <thomas@parisson.com>
Tue, 17 Jan 2017 16:52:02 +0000 (17:52 +0100)
The issue was caused by this change in Django 1.8:
In older versions, omitting both fields and exclude resulted in a form with all the model’s fields. Doing this now raises an ImproperlyConfigured exception.

See https://docs.djangoproject.com/en/1.8/topics/forms/modelforms/#selecting-the-fields-to-use

telemeta/forms/language.py
telemeta/forms/media.py
telemeta/forms/system.py

index c2dc960ac75efe4ca32c956045c5abb6721d5c31..5f43062a4859b3503ba63a097883d9f1289ef389 100644 (file)
@@ -25,3 +25,4 @@ from telemeta.models import *
 class LanguageForm(ModelForm):
     class Meta:
         model = Language
+        fields = '__all__'
index c76f98b9faebe34372d2a837fbfa48ce4e6441d9..717e42fddb1e24fdfe766d38452e9dba097ecff6 100644 (file)
@@ -95,7 +95,7 @@ class PlaylistForm(ModelForm):
 
     class Meta:
         model = Playlist
-
+        fields = '__all__'
 
 class FondsRelatedInline(InlineFormSet):
 
index f45754f4a5b965dbeb0d2ee5d817b01dd5dad9e5..ec0e3eb0af61822763c3f1463bd7175c440321f2 100644 (file)
@@ -26,3 +26,4 @@ from telemeta.models import *
 class UserProfileForm(ModelForm):
     class Meta:
         model = UserProfile
+        fields = '__all__'