From 9d5c4dbb33c91497e88b0b791ee31641531e778c Mon Sep 17 00:00:00 2001 From: liuzheng712 Date: Wed, 7 Oct 2015 12:36:20 +0800 Subject: [PATCH] juser/user_list change user password fix --- juser/views.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/juser/views.py b/juser/views.py index b91f9de17..6e7688d96 100644 --- a/juser/views.py +++ b/juser/views.py @@ -2,8 +2,8 @@ # Author: Guanghongwei # Email: ibuler@qq.com -import random -from Crypto.PublicKey import RSA +# import random +# from Crypto.PublicKey import RSA import uuid as uuid_r from django.db.models import Q @@ -650,10 +650,11 @@ def change_info(request): error = '密码须大于6位' if not error: - if password != user.password: - password = CRYPTOR.md5_crypt(password) + # if password != user.password: + # password = CRYPTOR.md5_crypt(password) - user.update(name=name, password=password, email=email) + user.update(name=name, email=email) + user.set_password(password) msg = '修改成功' return render_to_response('juser/change_info.html', locals(), context_instance=RequestContext(request))