summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorprathamesh2017-11-13 17:19:11 +0530
committerprathamesh2017-11-13 17:19:11 +0530
commita3a94ded76f02820b3a1536055dad0dc2dac81c5 (patch)
treec474bc7d251b0e43eb2e48f5af1906ebcf053909 /yaksh/views.py
parent847c24c0fe3c9d9f31ae4e5c3c0a68b783873592 (diff)
downloadonline_test-a3a94ded76f02820b3a1536055dad0dc2dac81c5.tar.gz
online_test-a3a94ded76f02820b3a1536055dad0dc2dac81c5.tar.bz2
online_test-a3a94ded76f02820b3a1536055dad0dc2dac81c5.zip
Added test case for add, update and remove
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index e7c2037..d49fad1 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1887,7 +1887,6 @@ def _read_user_csv(reader, course):
fields = reader.fieldnames
upload_details = ["Upload Summary:"]
counter = 0
- add_users = []
for row in reader:
counter += 1
(username, email, first_name, last_name, password, roll_no, institute,
@@ -1919,12 +1918,11 @@ def _read_user_csv(reader, course):
_create_or_update_profile(user, profile_defaults)
if created:
state = "Added"
- add_users.append(user)
+ course.students.add(user)
else:
state = "Updated"
upload_details.append("{0} -- {1} -- User {2} Successfully".format(
counter, user.username, state))
- course.students.add(*add_users)
if counter == 0:
upload_details.append("No rows in the CSV file")
return upload_details