summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprathamesh2017-11-06 15:51:05 +0530
committerprathamesh2017-11-06 15:51:05 +0530
commitbce87033267afdbb4aff958c26d1e6d0cac6d220 (patch)
tree19c4c0ae1081e4ea17aea81b5a92dfd7a10a066d
parentcde2eeb4f15de06def22d3bf07120a0a416e807f (diff)
downloadonline_test-bce87033267afdbb4aff958c26d1e6d0cac6d220.tar.gz
online_test-bce87033267afdbb4aff958c26d1e6d0cac6d220.tar.bz2
online_test-bce87033267afdbb4aff958c26d1e6d0cac6d220.zip
Added info for upload
converted list to set as dict.keys() returns list in python 2.7
-rw-r--r--yaksh/file_utils.py6
-rw-r--r--yaksh/templates/yaksh/course_detail.html5
2 files changed, 6 insertions, 5 deletions
diff --git a/yaksh/file_utils.py b/yaksh/file_utils.py
index 361b29c..0d80b8f 100644
--- a/yaksh/file_utils.py
+++ b/yaksh/file_utils.py
@@ -68,12 +68,12 @@ def is_csv(document):
def headers_present(dict_reader, headers):
fields = dict_reader.fieldnames
- clist = set()
+ header_fields = set()
for field in fields:
if field.strip() in headers.keys():
headers[field.strip()] = field
- clist.add(field.strip())
- if clist != headers.keys():
+ header_fields.add(field.strip())
+ if header_fields != set(headers.keys()):
return False
return True
diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html
index 3f13ea7..4b88ecb 100644
--- a/yaksh/templates/yaksh/course_detail.html
+++ b/yaksh/templates/yaksh/course_detail.html
@@ -49,8 +49,9 @@
<button class="btn btn-primary" type=submit> Upload Users <span class="glyphicon glyphicon-open"/></button>
</form>
<div class="alert alert-info" role="alert">
- The uploaded csv should have headers exactly same as mentioned below:<br>
- <b>firstname, lastname, email</b>
+ - The uploaded csv should have headers exactly same as mentioned below:<br>
+ <b>firstname, lastname, email</b><br></br>
+ - <b>Users created will have username and password same as their email</b>
</div>
</li>
</ul>