fix: Only import LDAP if it's enabled
This is disabled on 99%+ sites, still incurs 3-4MB of memory hit on import of ldap3.
This commit is contained in:
parent
423e781326
commit
cc43af984e
1 changed files with 4 additions and 2 deletions
|
|
@ -5,7 +5,6 @@ import frappe
|
|||
import frappe.utils
|
||||
from frappe import _
|
||||
from frappe.auth import LoginManager
|
||||
from frappe.integrations.doctype.ldap_settings.ldap_settings import LDAPSettings
|
||||
from frappe.rate_limiter import rate_limit
|
||||
from frappe.utils import cint, get_url
|
||||
from frappe.utils.data import escape_html
|
||||
|
|
@ -85,7 +84,10 @@ def get_context(context):
|
|||
)
|
||||
context["social_login"] = True
|
||||
|
||||
context["ldap_settings"] = LDAPSettings.get_ldap_client_settings()
|
||||
if cint(frappe.db.get_value("LDAP Settings", "LDAP Settings", "enabled")):
|
||||
from frappe.integrations.doctype.ldap_settings.ldap_settings import LDAPSettings
|
||||
|
||||
context["ldap_settings"] = LDAPSettings.get_ldap_client_settings()
|
||||
|
||||
login_label = [_("Email")]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue