fix in change password of profile settings page
This commit is contained in:
parent
9ee4adb27a
commit
ebcb8b3fac
@ -34,11 +34,14 @@ def change_password(arg):
|
|||||||
check_demo()
|
check_demo()
|
||||||
arg = load_json(arg)
|
arg = load_json(arg)
|
||||||
|
|
||||||
if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
|
if not webnotes.conn.sql("""select * from `__Auth` where `user`=%s
|
||||||
|
and password=password(%s)""",
|
||||||
|
(webnotes.session["user"], arg["old_password"])):
|
||||||
webnotes.msgprint('Old password is not correct', raise_exception=1)
|
webnotes.msgprint('Old password is not correct', raise_exception=1)
|
||||||
|
|
||||||
from webnotes.utils import nowdate
|
webnotes.conn.sql("""update `__Auth` set password=password(%s)
|
||||||
webnotes.conn.sql("update tabProfile set password=password(%s), modified=%s where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
|
where `user`=%s""", (arg["new_password"], webnotes.session["user"]))
|
||||||
|
|
||||||
webnotes.msgprint('Password Updated');
|
webnotes.msgprint('Password Updated');
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user