Changeset View
Changeset View
Standalone View
Standalone View
pykolab/utils.py
Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | if isinstance(_object, dict): | ||||
result[key.lower()] = _strip(_object[key]) | result[key.lower()] = _strip(_object[key]) | ||||
if 'objectsid' in result and not result['objectsid'][0] == "S": | if 'objectsid' in result and not result['objectsid'][0] == "S": | ||||
result['objectsid'] = sid_to_string(result['objectsid']) | result['objectsid'] = sid_to_string(result['objectsid']) | ||||
if 'sn' in result: | if 'sn' in result: | ||||
result['surname'] = ensure_str(result['sn']).replace(' ', '') | result['surname'] = ensure_str(result['sn']).replace(' ', '') | ||||
if 'givenname' in result: | |||||
result['givenname'] = ensure_str(result['givenname']).replace(' ', '') | |||||
if 'mail' in result: | if 'mail' in result: | ||||
if isinstance(result['mail'], list): | if isinstance(result['mail'], list): | ||||
result['mail'] = result['mail'][0] | result['mail'] = result['mail'][0] | ||||
result['mail'] = ensure_str(result['mail']) | result['mail'] = ensure_str(result['mail']) | ||||
if result['mail']: | if result['mail']: | ||||
if len(result['mail'].split('@')) > 1: | if len(result['mail'].split('@')) > 1: | ||||
▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines |