perf: Remove frappe.utils.password from import tree

This commit is contained in:
Aditya Hase 2021-02-21 09:41:28 +05:30
parent 2413f7e6ec
commit 3f0409a2af
No known key found for this signature in database
GPG key ID: 0A55F0FCA0234972

View file

@ -12,7 +12,6 @@ from frappe.model.naming import set_new_name
from frappe.model.utils.link_count import notify_link_count
from frappe.modules import load_doctype_module
from frappe.model import display_fieldtypes
from frappe.utils.password import get_decrypted_password, set_encrypted_password
from frappe.utils import (cint, flt, now, cstr, strip_html,
sanitize_html, sanitize_email, cast_fieldtype)
from frappe.utils.html_utils import unescape_html
@ -741,6 +740,8 @@ class BaseDocument(object):
def _save_passwords(self):
"""Save password field values in __Auth table"""
from frappe.utils.password import set_encrypted_password
if self.flags.ignore_save_passwords is True:
return
@ -755,6 +756,8 @@ class BaseDocument(object):
self.set(df.fieldname, '*'*len(new_password))
def get_password(self, fieldname='password', raise_exception=True):
from frappe.utils.password import get_decrypted_password
if self.get(fieldname) and not self.is_dummy_password(self.get(fieldname)):
return self.get(fieldname)