From 5d92e6fac7901c9829a759aec539e603dfb66038 Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 26 Apr 2016 19:00:01 +0530 Subject: rebase changes --- yaksh/forms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 681eca0..16f82fb 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -6,7 +6,7 @@ from django.contrib.auth.models import User from taggit.managers import TaggableManager from taggit.forms import TagField from django.forms.models import inlineformset_factory - +from django.db.models import Q from string import letters, punctuation, digits import datetime @@ -138,7 +138,8 @@ class QuizForm(forms.ModelForm): queryset=Quiz.objects.filter(course__creator=user)) self.fields['prerequisite'].required = False self.fields['course'] = forms.ModelChoiceField( - queryset=Course.objects.filter(creator=user)) + queryset=Course.objects.filter(Q(creator=user)| + Q(teachers=user)).distinct()) class Meta: model = Quiz -- cgit