Merge pull request #6246 from saurabh6790/get_reset_password_url

get link to reset password only if setup wizard is not completed
This commit is contained in:
Saurabh 2018-10-11 14:41:09 +05:30 committed by GitHub
commit 279a5d63e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -343,3 +343,15 @@ def reset_simultaneous_sessions(user_limit):
else:
frappe.db.set_value("User", user.name, "simultaneous_sessions", 1)
user_limit = user_limit - 1
def get_link_to_reset_password(user):
link = ''
if not cint(frappe.db.get_single_value('System Settings', 'setup_complete')):
user = frappe.get_doc("User", user)
link = user.reset_password(send_email=False)
frappe.db.commit()
return {
'link': link
}