diff options
author | ankitjavalkar | 2019-01-14 13:10:22 +0530 |
---|---|---|
committer | GitHub | 2019-01-14 13:10:22 +0530 |
commit | fac87512cd83af67cdbedcf4a597c6dc1325862d (patch) | |
tree | 009019fdd42126c296112b609c86a6ed2dccc831 /yaksh/views.py | |
parent | 567502f4376fe5a167d172bfcd08cf0ae4ac4caf (diff) | |
parent | 4b2d66d8208998f4fceb1178dd085bd3158d0b7a (diff) | |
download | online_test-fac87512cd83af67cdbedcf4a597c6dc1325862d.tar.gz online_test-fac87512cd83af67cdbedcf4a597c6dc1325862d.tar.bz2 online_test-fac87512cd83af67cdbedcf4a597c6dc1325862d.zip |
Merge pull request #510 from ankitjavalkar/fix-mod-dash-query
Fetch only distinct values for courses where User is Creator OR Teacher
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index de6a1a2..0f81931 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -383,7 +383,7 @@ def prof_manage(request, msg=None): if not is_moderator(user): return my_redirect('/exam/') courses = Course.objects.filter(Q(creator=user) | Q(teachers=user), - is_trial=False) + is_trial=False).distinct() trial_paper = AnswerPaper.objects.filter( user=user, question_paper__quiz__is_trial=True, course__is_trial=True @@ -905,8 +905,8 @@ def complete(request, reason=None, attempt_num=None, questionpaper_id=None, """Show a page to inform user that the quiz has been completed.""" user = request.user if questionpaper_id is None: - message = reason or "An Unexpected Error occurred. Please contact your '\ - 'instructor/administrator.'" + message = (reason or "An Unexpected Error occurred. Please contact your" + " instructor/administrator.") context = {'message': message} return my_render_to_response(request, 'yaksh/complete.html', context) else: |