def update_ldap_secured(apps, schema_editor):
    """Update ldap_secured settings."""
    LocalConfig = apps.get_model('core', 'LocalConfig')
    lc = LocalConfig.objects.first()
    if lc is None or 'ldap_secured' not in lc._parameters:
        return
    if lc._parameters['ldap_secured']:
        lc._parameters['ldap_secured'] = 'ssl'
    else:
        lc._parameters['ldap_secured'] = 'none'
    lc.save(update_fields=['_parameters'])
