summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2017-12-14 16:50:46 +0530
committeradityacp2017-12-14 16:50:46 +0530
commitb44db042059e69df4c4a948d6dff73604c7abf83 (patch)
treefee6cb0a3d634c1d1fab3b4a3e84f5e31ca928ba /yaksh/views.py
parent1063ea69f8ee39e5ba249b24700256383abb61ac (diff)
downloadonline_test-b44db042059e69df4c4a948d6dff73604c7abf83.tar.gz
online_test-b44db042059e69df4c4a948d6dff73604c7abf83.tar.bz2
online_test-b44db042059e69df4c4a948d6dff73604c7abf83.zip
Change in test_views and views
- Add new tests for views - Pep8 changes in views
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index cfeb666..483b87c 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2121,8 +2121,9 @@ def download_sample_csv(request):
"sample_user_upload.csv")
with open(csv_file_path, 'rb') as csv_file:
response = HttpResponse(csv_file.read(), content_type='text/csv')
- response['Content-Disposition'] = 'attachment;\
- filename="sample_user_upload"'
+ response['Content-Disposition'] = (
+ 'attachment; filename="sample_user_upload"'
+ )
return response
@@ -2142,6 +2143,7 @@ def duplicate_course(request, course_id):
return complete(request, msg, attempt_num=None, questionpaper_id=None)
return my_redirect('/exam/manage/courses/')
+
@login_required
@email_verified
def download_yaml_template(request):
@@ -2154,9 +2156,9 @@ def download_yaml_template(request):
yaml_file = zipfile.ZipFile(template_path, 'r')
template_yaml = yaml_file.open('questions_dump.yaml', 'r')
response = HttpResponse(template_yaml, content_type='text/yaml')
- response['Content-Disposition'] = 'attachment;\
- filename="questions_dump.yaml"'
-
+ response['Content-Disposition'] = (
+ 'attachment; filename="questions_dump.yaml"'
+ )
return response