Update password.py
This commit is contained in:
parent
52aed5e592
commit
b42e8f1210
1 changed files with 2 additions and 4 deletions
|
|
@ -59,10 +59,8 @@ def check_password(user, pwd, doctype='User', fieldname='password'):
|
|||
'''Checks if user and password are correct, else raises frappe.AuthenticationError'''
|
||||
|
||||
auth = frappe.db.sql("""select name, `password` from `__Auth`
|
||||
where doctype=%(doctype)s and name=%(name)s and fieldname=%(fieldname)s and encrypted=0""",
|
||||
{'doctype': doctype, 'name': user, 'fieldname': fieldname},
|
||||
as_dict=True
|
||||
)
|
||||
where doctype=%(doctype)s and name=%(name)s and fieldname=%(fieldname)s and encrypted=0""",
|
||||
{'doctype': doctype, 'name': user, 'fieldname': fieldname}, as_dict=True)
|
||||
|
||||
if not auth or not passlibctx.verify(pwd, auth[0].password):
|
||||
raise frappe.AuthenticationError(_('Incorrect User or Password'))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue