summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-12-29 07:10:36 -0500
committerGitHub2017-12-29 07:10:36 -0500
commite00c624d860552589d56d8fa3fdbe7a9245545e3 (patch)
tree2ba98e1af73ecf317ddf7575a4b2e0276bf84d5d /yaksh/views.py
parent63326f9519478f0d9bfb0b843e5dac8ab29428f4 (diff)
parent9c1c80277252fb6b151183bbf4995c96f25e31ff (diff)
downloadonline_test-e00c624d860552589d56d8fa3fdbe7a9245545e3.tar.gz
online_test-e00c624d860552589d56d8fa3fdbe7a9245545e3.tar.bz2
online_test-e00c624d860552589d56d8fa3fdbe7a9245545e3.zip
Merge pull request #406 from maheshgudi/fix_assignment
Fix assignment upload to work with new code server
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 74d352b..333b77f 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -579,6 +579,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
request, current_question, paper, notification=msg
)
for fname in assignment_filename:
+ fname._name = fname._name.replace(" ","_")
assignment_files = AssignmentUpload.objects.filter(
assignmentQuestion=current_question,
assignmentFile__icontains=fname, user=user,
@@ -588,7 +589,8 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
assignmentQuestion=current_question,
assignmentFile__icontains=fname, user=user,
question_paper=questionpaper_id)
- os.remove(assign_file.assignmentFile.path)
+ if os.path.exists(assign_file.assignmentFile.path):
+ os.remove(assign_file.assignmentFile.path)
assign_file.delete()
AssignmentUpload.objects.create(
user=user, assignmentQuestion=current_question,