summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authormaheshgudi2016-09-07 16:14:54 +0530
committermaheshgudi2016-09-07 16:14:54 +0530
commit6e2a0db4d67902cca52277d22dd7a67ebd059268 (patch)
tree770b9067974b572e3378c40a613567c1c49f4029 /yaksh/forms.py
parent8b01d249b7ccdff9d75447a6b12eb96641e795e7 (diff)
downloadonline_test-6e2a0db4d67902cca52277d22dd7a67ebd059268.tar.gz
online_test-6e2a0db4d67902cca52277d22dd7a67ebd059268.tar.bz2
online_test-6e2a0db4d67902cca52277d22dd7a67ebd059268.zip
removed initial form field from QuizForm and minor fixes in add_quiz view function and courses template
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 62179d5..23131b7 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -156,12 +156,11 @@ class QuizForm(forms.ModelForm):
course_id = kwargs.pop('course')
super(QuizForm, self).__init__(*args, **kwargs)
self.fields['prerequisite'] = forms.ModelChoiceField(
- queryset=Quiz.objects.filter(course__creator=user,
+ queryset=Quiz.objects.filter(course__id=course_id,
is_trial=False))
self.fields['prerequisite'].required = False
self.fields['course'] = forms.ModelChoiceField(
- queryset=Course.objects.filter(id=course_id))
- self.fields['course'].initial = Course.objects.get(id=course_id)
+ queryset=Course.objects.filter(id=course_id), empty_label=None)
class Meta:
model = Quiz