summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprathamesh2017-11-13 17:30:15 +0530
committerprathamesh2017-11-13 17:30:15 +0530
commit53ca24ea3eaf0e82cfa6e7c4614e200ef5b610e0 (patch)
tree2e86440ec827fc37bc54118effbe8ae19a0043c7
parenta3a94ded76f02820b3a1536055dad0dc2dac81c5 (diff)
downloadonline_test-53ca24ea3eaf0e82cfa6e7c4614e200ef5b610e0.tar.gz
online_test-53ca24ea3eaf0e82cfa6e7c4614e200ef5b610e0.tar.bz2
online_test-53ca24ea3eaf0e82cfa6e7c4614e200ef5b610e0.zip
set_password to convert into hash
-rw-r--r--yaksh/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index d49fad1..8d965f1 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1910,14 +1910,16 @@ def _read_user_csv(reader, course):
upload_details.append("{0} -- {1} not added to course".format(
counter, user))
continue
- user_defaults = {'password': password, 'email': email,
- 'first_name': first_name, 'last_name': last_name}
+ user_defaults = {'email': email, 'first_name': first_name,
+ 'last_name': last_name}
user, created = _create_or_update_user(username, user_defaults)
profile_defaults = {'institute': institute, 'roll_number': roll_no,
'department': department, 'is_email_verified': True}
_create_or_update_profile(user, profile_defaults)
if created:
state = "Added"
+ user.set_password(password)
+ user.save()
course.students.add(user)
else:
state = "Updated"