fix in reset password back to back reset at gateway
This commit is contained in:
parent
35cac63788
commit
8a620ddcdc
2 changed files with 9 additions and 3 deletions
|
|
@ -56,5 +56,6 @@ class DocType:
|
|||
from webnotes.utils.email_lib import sendmail_md
|
||||
sendmail_md(recipients= self.doc.email or self.doc.name, \
|
||||
msg = reset_password_mail % {"user": self.get_fullname(), "password":pwd}, \
|
||||
subject = 'Password Reset')
|
||||
|
||||
subject = 'Password Reset', from_defs=1)
|
||||
|
||||
return pwd
|
||||
|
|
|
|||
|
|
@ -174,7 +174,12 @@ def reset_password():
|
|||
|
||||
user = form_dict.get('user', '')
|
||||
if webnotes.conn.sql("""select name from tabProfile where name=%s""", user):
|
||||
get_obj('Profile', user).reset_password()
|
||||
pwd = get_obj('Profile', user).reset_password()
|
||||
try:
|
||||
from server_tools.gateway_utils import change_password
|
||||
change_password(new_password=pwd, user=user)
|
||||
except ImportError, e:
|
||||
pass
|
||||
webnotes.msgprint("Password has been reset and sent to your email id.")
|
||||
else:
|
||||
webnotes.msgprint("No such user (%s)", user)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue