Merge pull request #7090 from saurabh6790/password_fix

fix: do not check password strength while creating system manager
This commit is contained in:
Suraj Shetty 2019-03-20 13:24:55 +05:30 committed by GitHub
commit d30cd0b4b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,11 +269,6 @@ def add_system_manager(email, first_name=None, last_name=None, send_welcome_emai
"send_welcome_email": 1 if send_welcome_email else 0
})
if password:
user.update({
"new_password": password
})
user.insert()
# add roles
@ -281,6 +276,10 @@ def add_system_manager(email, first_name=None, last_name=None, send_welcome_emai
where name not in ("Administrator", "Guest", "All")""")
user.add_roles(*roles)
if password:
from frappe.utils.password import update_password
update_password(user=user.name, pwd=password)
def get_enabled_system_users():
return frappe.db.sql("""select * from tabUser where
user_type='System User' and enabled=1 and name not in ('Administrator', 'Guest')""", as_dict=1)