summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authoradityacp2016-09-16 20:28:21 +0530
committeradityacp2016-09-16 20:28:21 +0530
commitbfd75a4b87339c5037ad2d412e45ee12b223dd02 (patch)
treeda62b336a5b5681c4b0878a72170ee8d9f0bf037 /yaksh/forms.py
parent2efd65cb2dd276e1560c8993e13d9db95e6c8ba0 (diff)
parent5b2a6fe665a3add0916a255e5436841b820146ee (diff)
downloadonline_test-bfd75a4b87339c5037ad2d412e45ee12b223dd02.tar.gz
online_test-bfd75a4b87339c5037ad2d412e45ee12b223dd02.tar.bz2
online_test-bfd75a4b87339c5037ad2d412e45ee12b223dd02.zip
changed course template to view demo course
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 4a20102..23131b7 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -153,13 +153,14 @@ class QuizForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
user = kwargs.pop('user')
+ 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(Q(creator=user)|
- Q(teachers=user)).distinct())
+ queryset=Course.objects.filter(id=course_id), empty_label=None)
class Meta:
model = Quiz