]> git.parisson.com Git - teleforma.git/commitdiff
fix initial
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 3 Feb 2016 16:54:08 +0000 (17:54 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 3 Feb 2016 16:54:08 +0000 (17:54 +0100)
teleforma/forms.py

index cca6fc749bd17269b67a6452c2c9c18d2a410b66..6d8b67f7979037fc2021415d395e0871158e2391 100644 (file)
@@ -65,6 +65,8 @@ class StudentInline(InlineFormSet):
     fields = ['iej', 'period', 'procedure', 'written_speciality', 'oral_speciality',
                 'oral_1', ]
 
-    def __init__(self, *args, **kwargs):
-        super(StudentInline,self ).__init__(*args,**kwargs) # populates the post
-        self.fields['procedure'].queryset = Course.objects.filter(name__in='civil')
+    def get_initial(self):
+        initial = super(StudentInline,self ).get_initial()
+        initial['procedure'].queryset = Course.objects.filter(title__contains='civil')
+        return initial
+