* fix(unicode): Import unicode_literals in every file * fix(unicode): Test if safe_json_loads return unicode instead of bytes
22 lines
534 B
Python
22 lines
534 B
Python
from __future__ import unicode_literals
|
|
import frappe
|
|
from frappe.utils import cint
|
|
|
|
def execute():
|
|
frappe.reload_doc("integrations", "doctype", "ldap_settings")
|
|
|
|
if not frappe.db.exists("DocType", "Integration Service"):
|
|
return
|
|
|
|
if not frappe.db.exists("Integration Service", "LDAP"):
|
|
return
|
|
|
|
if not cint(frappe.db.get_value("Integration Service", "LDAP", 'enabled')):
|
|
return
|
|
|
|
import ldap
|
|
try:
|
|
ldap_settings = frappe.get_doc("LDAP Settings")
|
|
ldap_settings.save(ignore_permissions=True)
|
|
except ldap.LDAPError:
|
|
pass
|