mirror of
				https://github.com/jumpserver/jumpserver.git
				synced 2025-11-03 23:47:27 +00:00 
			
		
		
		
	juser/user_list change user password fix
This commit is contained in:
		@@ -2,8 +2,8 @@
 | 
				
			|||||||
# Author: Guanghongwei
 | 
					# Author: Guanghongwei
 | 
				
			||||||
# Email: ibuler@qq.com
 | 
					# Email: ibuler@qq.com
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import random
 | 
					# import random
 | 
				
			||||||
from Crypto.PublicKey import RSA
 | 
					# from Crypto.PublicKey import RSA
 | 
				
			||||||
import uuid as uuid_r
 | 
					import uuid as uuid_r
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.db.models import Q
 | 
					from django.db.models import Q
 | 
				
			||||||
@@ -650,10 +650,11 @@ def change_info(request):
 | 
				
			|||||||
            error = '密码须大于6位'
 | 
					            error = '密码须大于6位'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not error:
 | 
					        if not error:
 | 
				
			||||||
            if password != user.password:
 | 
					            # if password != user.password:
 | 
				
			||||||
                password = CRYPTOR.md5_crypt(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 = '修改成功'
 | 
					            msg = '修改成功'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return render_to_response('juser/change_info.html', locals(), context_instance=RequestContext(request))
 | 
					    return render_to_response('juser/change_info.html', locals(), context_instance=RequestContext(request))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user