summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authormaheshgudi2017-12-18 19:53:59 +0530
committermaheshgudi2017-12-29 17:08:44 +0530
commit9c1c80277252fb6b151183bbf4995c96f25e31ff (patch)
tree2ba98e1af73ecf317ddf7575a4b2e0276bf84d5d /yaksh/views.py
parent63326f9519478f0d9bfb0b843e5dac8ab29428f4 (diff)
downloadonline_test-9c1c80277252fb6b151183bbf4995c96f25e31ff.tar.gz
online_test-9c1c80277252fb6b151183bbf4995c96f25e31ff.tar.bz2
online_test-9c1c80277252fb6b151183bbf4995c96f25e31ff.zip
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,