diff options
author | Prabhu Ramachandran | 2017-03-17 17:54:14 +0530 |
---|---|---|
committer | GitHub | 2017-03-17 17:54:14 +0530 |
commit | 23ecd8fa33e7fa2e953aa9715ae45a2869a044a0 (patch) | |
tree | ef559dee40ee85d3aa15fbaf824273e9e98a2d55 /yaksh/views.py | |
parent | f6a6a952de703be4040d30edb36b9e6cf1228daf (diff) | |
parent | 6c53c90ee5dd7184889fd3f99130b194e75fef4c (diff) | |
download | online_test-23ecd8fa33e7fa2e953aa9715ae45a2869a044a0.tar.gz online_test-23ecd8fa33e7fa2e953aa9715ae45a2869a044a0.tar.bz2 online_test-23ecd8fa33e7fa2e953aa9715ae45a2869a044a0.zip |
Merge pull request #244 from adityacp/display_err_msg
Display error message while uploading questions
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 63653e6..daa81eb 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -20,7 +20,6 @@ import pytz from taggit.models import Tag from itertools import chain import json -import zipfile import six # Local imports. from yaksh.models import get_model_class, Quiz, Question, QuestionPaper, QuestionSet, Course @@ -894,7 +893,8 @@ def show_all_questions(request): if request.POST.get('delete') == 'delete': data = request.POST.getlist('question') if data is not None: - questions = Question.objects.filter(id__in=data, user_id=user.id, active=True) + questions = Question.objects.filter(id__in=data, user_id=user.id, + active=True) for question in questions: question.active = False question.save() @@ -907,7 +907,8 @@ def show_all_questions(request): if file_name[-1] == "zip": ques = Question() files, extract_path = extract_files(questions_file) - ques.read_json(extract_path, user, files) + context['message'] = ques.read_json(extract_path, user, + files) else: message = "Please Upload a ZIP file" context['message'] = message @@ -947,7 +948,6 @@ def show_all_questions(request): return my_render_to_response('yaksh/showquestions.html', context, context_instance=ci) - @login_required def user_data(request, user_id, questionpaper_id=None): """Render user data.""" |